Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
6.5.0
-
None
-
Qt 6.5.0 for macOS and for Web Assembly (both single- and multi-threaded)
Description
For platforms where USE_THREADED_DOWNLOAD is 0, like Web Assembly or desktop builds configured with -no-feature-thread, QQuickPixmapCache does not properly handle remote sources for QML Image elements. Image's status property hangs at Image.Loading (tried with both http and https sources).
After some investigation, I've noticed that, at QQuickPixmapReader::run(), the qScopeGuard seems to destroy threadObject before the download is fully completed:
const auto guard = qScopeGuard([this]() { // We need to delete the threadObject from the same thread. QMutexLocker lock(&mutex); delete threadObject; threadObject = nullptr; } );
That happens because the event loop created by exec() isn't invoked when USE_THREADED_DOWNLOAD is 0:
#if USE_THREADED_DOWNLOAD
exec();
#endif
Commenting out (or surrounding with #if USE_THREADED_DOWNLOAD) the qScopeGuard block "fixes" the issue but I'm not sure whether threadObject is actually instantiated for non-threaded builds (which then would generate a memory leak if so).
NOTE: this isn't exclusive of Web Assembly builds, it also happens for macOS desktop builds with -no-feature-thread.
Minimal example attached.
Attachments
Issue Links
- duplicates
-
QTBUG-111892 wasm: asynchronous image loading never ends
-
- Closed
-