aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2018-11-30 14:18:20 +1000
committerLorn Potter <lorn.potter@gmail.com>2018-12-13 19:08:50 +0000
commit48eb8da7f4bde39e2f9d1a6eef4978d11bf67ca1 (patch)
treef99ba312a4f528112315bde72fe67609638f9ac7
parent1b79a40466ccb1ba52b596c69f3af607a1148b07 (diff)
nothread: do not delete reader thread object before it gets used
exec is an empty function on nothread and returns right away, so the pixmap reader thread object gets deleted before it can download the url Task-number: QTBUG-72105 Change-Id: If205dbe12d0b5299b43a68e7d0d955a2b89b4af1 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r--src/quick/util/qquickpixmapcache.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 0dd2a88ca1..c1bf2160da 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -471,6 +471,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()
@@ -948,8 +952,11 @@ void QQuickPixmapReader::run()
processJobs();
exec();
+#if QT_CONFIG(thread)
+ // nothread exec is empty and returns
delete threadObject;
threadObject = nullptr;
+#endif
}
class QQuickPixmapKey