Fix crash in QQuickPixmapData::release()
authorChris Adams <christopher.adams@nokia.com>
Thu, 21 Jun 2012 07:21:07 +0000 (17:21 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 21 Jun 2012 07:58:56 +0000 (09:58 +0200)
commitb89c6459d760e68c629c0d318d2afd494a2a415a
tree63397a3e5aae9261dc0c80f5488d66661aef950c
parent73e0e7cd53d2ce457d2cab02895eb253902c555a
Fix crash in QQuickPixmapData::release()

Previously, if the reader was deleted (eg, via engine destruction)
the reply might be deleted without letting the associated
QQuickPixmapData know about it.  If that data was later released,
it would attempt to write to previously freed memory.

This commit ensures that the data's reply ptr is set to zero when
the reply is deleted by the reader dtor.  It also adds a comment to
the reply dtor to explain why it is important.

A unit test for this issue already exists:
tst_qquickpixmapcache::lockingCrash() run under valgrind.

Change-Id: Icd94528e1336db1c00b118b3f6d1222eef402c46
Reviewed-by: Martin Jones <martin.jones@nokia.com>
src/quick/util/qquickpixmapcache.cpp