aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Shaforostov <mshaforostov@airmusictech.com>2020-11-06 18:38:20 +0100
committerLorn Potter <lorn.potter@gmail.com>2020-11-18 08:52:53 +0000
commitda9b9a4e6e2cddd6dd1dbf2e126fc2d332bc0616 (patch)
tree3df66f019ce8e723d7e858676f6998bd9adb1cc5
parent205a202bc008b3a6234b3ed7225abe14f0083745 (diff)
pixmapcache: avoid deadlock when canceling async image load
was only possible if qml_network is disabled Pick-to: 5.15 Change-Id: If8a8addc0aa5c4c768dd7df3aa4d627f82a78059 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
-rw-r--r--src/quick/util/qquickpixmapcache.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 8e56287bba..1550e7e65d 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -693,9 +693,9 @@ void QQuickPixmapReader::processJobs()
// Clean cancelled jobs
if (!cancelled.isEmpty()) {
-#if QT_CONFIG(qml_network)
for (int i = 0; i < cancelled.count(); ++i) {
QQuickPixmapReply *job = cancelled.at(i);
+#if QT_CONFIG(qml_network)
QNetworkReply *reply = networkJobs.key(job, 0);
if (reply) {
networkJobs.remove(reply);
@@ -711,11 +711,11 @@ void QQuickPixmapReader::processJobs()
}
}
PIXMAP_PROFILE(pixmapStateChanged<QQuickProfiler::PixmapLoadingError>(job->url));
+#endif
// deleteLater, since not owned by this thread
job->deleteLater();
}
cancelled.clear();
-#endif
}
if (!jobs.isEmpty()) {