Fix memory leak when QQuickPixmapReply::Event is delete before being used
authorAlbert Astals Cid <albert.astals@canonical.com>
Fri, 14 Aug 2015 13:51:43 +0000 (15:51 +0200)
committerAlbert Astals Cid <albert.astals@canonical.com>
Wed, 19 Aug 2015 10:25:11 +0000 (10:25 +0000)
commit16916560c13bf4c096461426c37eccbc8841a13c
treefe825dadea73c401d93c523167290d8ebb2d5f39
parent521ace713d8e5230d47f3da8cd941699ca085af2
Fix memory leak when QQuickPixmapReply::Event is delete before being used

It can happen that QQuickPixmapReply::postReply is called, and before
QQuickPixmapReply::event is called the object gets deleted. That means that
the texture factory will never be deleted.

To fix that we delete it in the destructor of QQuickPixmapReply::Event and set
it to 0 in QQuickPixmapReply::event after assigning to the next data structure
that will take care of it

Change-Id: Ibea62f5a10a53cca586de7c5f03f00aabfb88b2e
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
src/quick/util/qquickpixmapcache.cpp