I encountered recently some weird crashes in the application that I'm developing, not 100% reproducible but that happen on precise actions.
My researches allowed me to isolate the following scenario:
- Start an animated image
- Connect to its frameChanged
- When the frameChanged happens, change the source of the AnimatedImage
- Valgrind will yell and the application will most of the time crash.
The reason is the code of QMovie that emits the frameChanged:
Combined to the code of QQuickAnimatedImage:
So when we listen to frameChanged in QML, and change the source, it will destroy the QMovie, but QMovie will execute after two more lines to start the timer for its next frame:
This is the cause of the crash.
You can also reproduce it with a more "isolated" code that simulates what AnimatedImage does:
I don't know how to fix it or if we have to fix it/document it. Do you have any suggestion?
|For Gerrit Dashboard: QTBUG-67427|
|224931,3||Fix crash when changing the source of AnimatedImage after a frame change||5.11||qt/qtdeclarative||Status: MERGED||+2||0|