diff options
author | Louis du Verdier <louis.du.verdier@free.fr> | 2018-04-02 20:25:37 +0200 |
---|---|---|
committer | Louis du Verdier <louis.du.verdier@free.fr> | 2018-05-08 16:19:45 +0000 |
commit | a609554c031fd57d9a2a3905f5a02cc6b4aa19e9 (patch) | |
tree | 22a56bc1cd7a67f447a5a67746376fc5776047e9 /tests/auto/quick/qquickaccessible | |
parent | bdbf6a53c0ab8a7f6ea5586767a6ed818e3d555e (diff) |
Fix crash when changing the source of AnimatedImage after a frame change
QMovie emits the signals updated() and frameChanged(), and restarts
right after its timer to prepare for the next frame. Since AnimatedImage
destroys its underlying QMovie when its source changes, the lines after
emit frameChanged() in QMovie will use free'd memory and will most of
the time produce a crash.
This fix delays the destruction of the underlying QMovie of
AnimatedImage using deleteLater() to prevent this kind of behavior from
happening without impact/behavior change in the code of QMovie. Unit
tests added as well to cover this situation.
This commit also fixes a similar crash when Component.onCompleted is
called and when the source changes in the associated callback.
Task-number: QTBUG-67427
Change-Id: Ic6568a1bc251e5fa2ee1cf8e5f50eaa56c3007db
Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Louis du Verdier <louis.du.verdier@free.fr>
Diffstat (limited to 'tests/auto/quick/qquickaccessible')
0 files changed, 0 insertions, 0 deletions