aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util/qquickpixmapcache.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-12-23 01:00:12 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-12-23 01:00:12 +0100
commitdca7fc3e3a0fe428ed97762a44c15e83607e6d28 (patch)
tree97d33fe2bec52dcbb6c991712bfe39411fbddb91 /src/quick/util/qquickpixmapcache.cpp
parent03b084e6397b990c69028dc2bbf3226e7339c4a5 (diff)
parentc57681bc376d1d912d23b044c48932fa8f7816d7 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src/quick/util/qquickpixmapcache.cpp')
-rw-r--r--src/quick/util/qquickpixmapcache.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index ea6d376ce7..ced0acd9ab 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -480,6 +480,10 @@ QQuickPixmapReader::QQuickPixmapReader(QQmlEngine *eng)
eventLoopQuitHack->moveToThread(this);
connect(eventLoopQuitHack, SIGNAL(destroyed(QObject*)), SLOT(quit()), Qt::DirectConnection);
start(QThread::LowestPriority);
+#if !QT_CONFIG(thread)
+ // call nonblocking run ourself, as nothread qthread does not
+ run();
+#endif
}
QQuickPixmapReader::~QQuickPixmapReader()
@@ -957,8 +961,11 @@ void QQuickPixmapReader::run()
processJobs();
exec();
+#if QT_CONFIG(thread)
+ // nothread exec is empty and returns
delete threadObject;
threadObject = nullptr;
+#endif
}
class QQuickPixmapKey
@@ -1028,7 +1035,8 @@ QQuickPixmapStore::~QQuickPixmapStore()
m_timerId = -2;
// unreference all (leaked) pixmaps
- for (auto *pixmap : qAsConst(m_cache)) {
+ const auto cache = m_cache; // NOTE: intentional copy (QTBUG-65077); releasing items from the cache modifies m_cache.
+ for (auto *pixmap : cache) {
int currRefCount = pixmap->refCount;
if (currRefCount) {
#ifndef QT_NO_DEBUG