Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
5.9.0
-
None
Description
QQuickAnimatedImage loading twice when the image is displays in window placed on second monitor and when that image loads with asynchronous network request.
That causes a memory leak and a possible crash.
QQuickAnimatedImage::load() normaly calls from QQuickAnimatedImage::componentComplete(), but a second call occuried immediately after the screenChanged signal was emmited and handled with QQuickImageBase::handleScreenChanged.
When processing QQuickAnimatedImage::load() with first call, the "d->reply" object is initialized here:
d->reply = qmlEngine(this)->networkAccessManager()->get(req);
but when processing with a second call, "d->reply" object is initialized again, but previous one was not destroyed!
After that "finished" signal is also handled twice with QQuickAnimatedImage::movieRequestFinished(). First call of it will initialize "d->_movie" object here:
d->_movie = new QMovie(d->reply);
and the second call will do the same with generating next memory leak. Moreover, if "d->_movie" will be not valid with second call, than the crash will be occuried in QQuickAnimatedImage::playingStatusChanged(), that was connected to "stateChanged" signal on first call. Because QQuickAnimatedImage::playingStatusChanged() has no check for "d->_movie" for nullptr.
Attachments
Issue Links
- relates to
-
QTBUG-46619 Growing memory when AnimatedImage is playing
- Reported
-
QTBUG-64272 AnimatedImage uses a lot of memory when caching is enabled
- Open
-
QTBUG-24869 Use of MNG with a LOOP block causes memory leak in AnimatedImage QML element
- Open