Prevent possible leak with texture providers.
authorMichael Brasser <michael.brasser@live.com>
Fri, 25 Jan 2013 16:22:08 +0000 (10:22 -0600)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 25 Jan 2013 21:31:04 +0000 (22:31 +0100)
If the job has been cancelled, ensure we clean up the texture factory
that was created.

Change-Id: I0a6e4a23732e6041084ddc483d701a25befd91c9
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
src/quick/util/qquickpixmapcache.cpp

index e43c5e9..dda2fbe 100644 (file)
@@ -565,6 +565,8 @@ void QQuickPixmapReader::processJob(QQuickPixmapReply *runningJob, const QUrl &u
             mutex.lock();
             if (!cancelled.contains(runningJob))
                 runningJob->postReply(errorCode, errorStr, readSize, t);
+            else
+                delete t;
             mutex.unlock();
 
         }