aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickpixmapcache.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/util/qquickpixmapcache.cpp')
-rw-r--r--src/quick/util/qquickpixmapcache.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 2b6e8f68c3..597613c9fd 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -455,13 +455,19 @@ QQuickPixmapReader::~QQuickPixmapReader()
}
jobs.clear();
#ifndef QT_NO_NETWORK
- QList<QQuickPixmapReply*> activeJobs = networkJobs.values() + asyncResponses.values();
- foreach (QQuickPixmapReply *reply, activeJobs ) {
+
+ const auto cancelJob = [this](QQuickPixmapReply *reply) {
if (reply->loading) {
cancelled.append(reply);
reply->data = 0;
}
- }
+ };
+
+ for (auto *reply : qAsConst(networkJobs))
+ cancelJob(reply);
+
+ for (auto *reply : qAsConst(asyncResponses))
+ cancelJob(reply);
#endif
if (threadObject) threadObject->processJobs();
mutex.unlock();