Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
5.6.2, 5.7.1, 5.8.0, 5.9.0 Alpha
-
None
Description
The code creating a QQuickImageResponse has a race condition:
qtdeclarative/src/quick/util/qquickpixmapcache.cpp
case QQuickImageProvider::ImageResponse: { QQuickAsyncImageProvider *asyncProvider = static_cast<QQuickAsyncImageProvider*>(provider); QQuickImageResponse *response = asyncProvider->requestImageResponse(imageId(url), runningJob->requestSize); QObject::connect(response, SIGNAL(finished()), threadObject, SLOT(asyncResponseFinished())); asyncResponses.insert(response, runningJob); break; }
If the processing is finished very fast (e.g. multi-threaded), QQuickImageResponse will send finished() signal before QQuickPixmapCache has a chance to connect() to it and the image will never be shown.
A possible solution would be to introduce a new method QQuickImageResponse::start() that should be called after the connection has been established.