aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/animations/qparallelanimationgroupjob.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2012-02-13 10:11:26 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-13 10:27:31 +0100
commit815b4b463da83802f535b328d7ef699aea529a6b (patch)
tree27a6dfcb21dd353bc81231cf2b60369107ef9078 /src/declarative/animations/qparallelanimationgroupjob.cpp
parentab84713eb211fdcc2fc63be6860498d4b4186d11 (diff)
Don't crash when an animation update causes it to delete itself.
Change-Id: Ic108adfb99a09e6ede71d474240fb0917cee6961 Reviewed-by: Bea Lam <bea.lam@nokia.com>
Diffstat (limited to 'src/declarative/animations/qparallelanimationgroupjob.cpp')
-rw-r--r--src/declarative/animations/qparallelanimationgroupjob.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/declarative/animations/qparallelanimationgroupjob.cpp b/src/declarative/animations/qparallelanimationgroupjob.cpp
index ff38be382d..9411ad862c 100644
--- a/src/declarative/animations/qparallelanimationgroupjob.cpp
+++ b/src/declarative/animations/qparallelanimationgroupjob.cpp
@@ -40,6 +40,7 @@
****************************************************************************/
#include "private/qparallelanimationgroupjob_p.h"
+#include "private/qanimationjobutil_p.h"
QT_BEGIN_NAMESPACE
@@ -84,7 +85,7 @@ void QParallelAnimationGroupJob::updateCurrentTime(int /*currentTime*/)
if (dura > 0) {
for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
if (!animation->isStopped())
- animation->setCurrentTime(dura); // will stop
+ RETURN_IF_DELETED(animation->setCurrentTime(dura)); // will stop
}
}
} else if (m_currentLoop < m_previousLoop) {
@@ -93,7 +94,7 @@ void QParallelAnimationGroupJob::updateCurrentTime(int /*currentTime*/)
//we need to make sure the animation is in the right state
//and then rewind it
applyGroupState(animation);
- animation->setCurrentTime(0);
+ RETURN_IF_DELETED(animation->setCurrentTime(0));
animation->stop();
}
}
@@ -110,7 +111,7 @@ void QParallelAnimationGroupJob::updateCurrentTime(int /*currentTime*/)
}
if (animation->state() == state()) {
- animation->setCurrentTime(m_currentTime);
+ RETURN_IF_DELETED(animation->setCurrentTime(m_currentTime));
if (dura > 0 && m_currentTime > dura)
animation->stop();
}