Fix crash with cleanup of animators.
authorGunnar Sletta <gunnar@sletta.org>
Thu, 28 Aug 2014 09:27:02 +0000 (11:27 +0200)
committerGunnar Sletta <gunnar@sletta.org>
Sat, 30 Aug 2014 07:55:37 +0000 (09:55 +0200)
commit8f3311276e4ca44acb69c8870ccfc3167682b898
tree616be3b67d4de0424bd0c517dd75fe0d93bc74ee
parent68690c3703b151e95eb5dfd8d9db7afda49c7c6f
Fix crash with cleanup of animators.

We had several separate issues relating to how the jobs were cleaned up.

The first was that upon getting setWindow(0), the animator did not
reset m_controller to 0, leading to the starts() coming after that to
post null jobs to the controller. This would later crash in
beforeNodeSync as the starting job was null.

The second issue was that during shutdown, QQuickAnimatorProxy
would try to delete jobs on the controller which was already
deleted. The controller is deleted on the GUI thread regardless
of render loop, so this was solved with a QPointer.

The third was that we were a bit too aggressive in trying to clean up
jobs on the GUI thread, so we introduced a new bool which gets set to
true in startJob() so that Proxy::deleteJob() knows who owns the job.

Task-number: QTBUG-37833
Change-Id: I1b6221a2c1ce2bfd0758801b950cda00ff6899d0
Reviewed-by: Michael Brasser <michael.brasser@live.com>
src/quick/util/qquickanimatorcontroller.cpp
src/quick/util/qquickanimatorjob.cpp
src/quick/util/qquickanimatorjob_p.h