Fix crash with running animators on re-shown windows.
authorGunnar Sletta <gunnar.sletta@jollamobile.com>
Thu, 15 May 2014 19:01:06 +0000 (21:01 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Mon, 19 May 2014 09:15:08 +0000 (11:15 +0200)
commit851ae1a77dc207ec11b8ed3f0786bfe1c1905e4c
tree6576f581a94851366e4481ea6994b610636f5fe0
parent8f6254a88e4c634203df779aa385d9955e91b56f
Fix crash with running animators on re-shown windows.

The non-threaded render loops would clean up the nodes for a window
when it was hidden, but the animators kept running and had a reference
to the deleted nodes. This was not a problem for the threaded render
loop as it would wipe the animator controller as well which would
clean the jobs.

Fix it by triggering a reset of all nodes in the animators when the
window is told to clean up. If an animator is ticked when it doesn't
have a node, it will simply do nothing. When the window is made visible
again, we call initialize on all animators to find the new node.

Task-number: QTBUG-37995
Change-Id: Ie5609d95db29f4b2b30ca5bf641dce901e528389
Reviewed-by: Michael Brasser <michael.brasser@live.com>
src/quick/items/qquickwindow.cpp
src/quick/util/qquickanimatorcontroller.cpp
src/quick/util/qquickanimatorcontroller_p.h
src/quick/util/qquickanimatorjob.cpp
src/quick/util/qquickanimatorjob_p.h
tests/auto/qmltest/animators/tst_multiwindow.qml [new file with mode: 0644]