aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2025-06-18 08:38:22 +0200
committerUlf Hermann <[email protected]>2025-06-24 14:38:12 +0200
commitfe1f9b2c970eb5c24ed689cbc2995c5ea40d7146 (patch)
tree53781cb345c70b00eb9ae7e399eb832e8ba7634b
parentc1924afcd8239b294bcb0380f573474b5eb16906 (diff)
QQuickPixmapReader: Trigger typeloader creation before thread start
The type loader can be requested from different threads but should be created on the engine thread. Amends commit d2bc4a4330254c0c68a0ade51b59a71c4b67b470 Fixes: QTBUG-137848 Change-Id: I30d93e6351bd67ded94956f9832cb87157823373 Reviewed-by: Olivier De Cannière <[email protected]>
-rw-r--r--src/quick/util/qquickpixmapcache.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 3f412bf84a..2b629739d8 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -597,6 +597,11 @@ QQuickPixmapReader::QQuickPixmapReader(QQmlEngine *eng)
, accessManager(nullptr)
#endif
{
+ // Make sure the type loader exists before we start the thread.
+ // We might need it to create a network access manager and we must
+ // construct it from the engine thread.
+ engine->handle()->typeLoader();
+
Q_DETACH_THREAD_AFFINITY_MARKER(m_readerThreadAffinityMarker);
#if QT_CONFIG(quick_pixmap_cache_threaded_download)
eventLoopQuitHack = new QObject;