-
Bug
-
Resolution: Done
-
P1: Critical
-
5.6.2, 5.7.1, 5.8.0, 5.9.0 Alpha
-
None
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.
| For Gerrit Dashboard: QTBUG-59601 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 194056,1 | Race condition when starting QQuickImageResponse | dev | qt/qtdeclarative | Status: ABANDONED | -1 | 0 |
| 229661,5 | Fix race condition in async image response handling | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |