diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-12-23 01:00:12 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-12-23 01:00:12 +0100 |
commit | dca7fc3e3a0fe428ed97762a44c15e83607e6d28 (patch) | |
tree | 97d33fe2bec52dcbb6c991712bfe39411fbddb91 /src/quick/util/qquickpixmapcache.cpp | |
parent | 03b084e6397b990c69028dc2bbf3226e7339c4a5 (diff) | |
parent | c57681bc376d1d912d23b044c48932fa8f7816d7 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Change-Id: I9c3d282c11a556e616c5e1ba1b51e88b741327f6
Diffstat (limited to 'src/quick/util/qquickpixmapcache.cpp')
-rw-r--r-- | src/quick/util/qquickpixmapcache.cpp | 10 |
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 |