summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2016-09-29 17:35:31 +0200
committerAlbert Astals Cid <albert.astals@canonical.com>2016-10-03 14:09:52 +0000
commitf986c0c3390ba7d033b6e6276f63dcd4818adb5c (patch)
treedef3f4589f15f3438fe3c1314f63546e60ec474e /src
parent3763008370833508104dbf2ed8296e8925207563 (diff)
Fix crash on cancel QQuickImageResponse
We don't need to deleteLater here, we can not be sure that the response won't continue for a bit after this, and it's not even needed since documentation says you need to emit finished in all cases and this will call deleteLater on the response anyway. Task-number: QTBUG-56056 Change-Id: I7cc90620f499beaaaaa61aac77d72d067308838c Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src')
-rw-r--r--src/quick/util/qquickimageprovider.cpp2
-rw-r--r--src/quick/util/qquickpixmapcache.cpp1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp
index d11229717a..9ed38f72c6 100644
--- a/src/quick/util/qquickimageprovider.cpp
+++ b/src/quick/util/qquickimageprovider.cpp
@@ -181,6 +181,8 @@ QString QQuickImageResponse::errorString() const
This method is used to communicate that the response is no longer required by the engine.
It may be reimplemented to cancel a request in the provider side, however, it is not mandatory.
+
+ A cancelled QQuickImageResponse still needs to emit finished().
*/
void QQuickImageResponse::cancel()
{
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 230c31807c..50b6de25fb 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -584,7 +584,6 @@ void QQuickPixmapReader::processJobs()
if (asyncResponse) {
asyncResponses.remove(asyncResponse);
asyncResponse->cancel();
- asyncResponse->deleteLater();
}
}
PIXMAP_PROFILE(pixmapStateChanged<QQuickProfiler::PixmapLoadingError>(job->url));