Fix crash when animators are deleted just after being started.
authorGunnar Sletta <gunnar.sletta@jollamobile.com>
Wed, 6 Aug 2014 09:01:06 +0000 (11:01 +0200)
committerGunnar Sletta <gunnar.sletta@jollamobile.com>
Fri, 8 Aug 2014 05:11:24 +0000 (07:11 +0200)
Change-Id: I35850e279dae596edb9a1b93143d6aa195221b41
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
src/quick/util/qquickanimatorjob.cpp

index 0bf95a4..9f81f28 100644 (file)
@@ -97,9 +97,11 @@ QQuickAnimatorProxyJob::~QQuickAnimatorProxyJob()
 void QQuickAnimatorProxyJob::deleteJob()
 {
     if (m_job) {
-        if (m_controller && m_internalState != State_Starting)
+        // If we have a controller, we might have posted the job to be started
+        // so delete it through the controller to clean up properly.
+        if (m_controller)
             m_controller->deleteJob(m_job);
-        else if (m_internalState == State_Starting)
+        else
             delete m_job;
         m_job = 0;
     }