aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar.sletta@jollamobile.com>2014-03-31 13:47:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-07 15:49:09 +0200
commit91acf022e97ecda51e5b4ecd8b0b946f74a3bfac (patch)
treefe72ec3a54d113502b7b75d3965cd18409807d44 /src/qml/animations
parent58caedf0fdc6b63751577972473ae27dd36499f5 (diff)
Don't start continuing animation when it doesn't have children.
If we did, it would never stop. Change-Id: Ie9d8f1731f6fa555f8dd6a56d6967a8f8f19a9f4 Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/qml/animations')
-rw-r--r--src/qml/animations/qcontinuinganimationgroupjob.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/qml/animations/qcontinuinganimationgroupjob.cpp b/src/qml/animations/qcontinuinganimationgroupjob.cpp
index eb54b6e9aa..17ab071bf2 100644
--- a/src/qml/animations/qcontinuinganimationgroupjob.cpp
+++ b/src/qml/animations/qcontinuinganimationgroupjob.cpp
@@ -55,8 +55,7 @@ QContinuingAnimationGroupJob::~QContinuingAnimationGroupJob()
void QContinuingAnimationGroupJob::updateCurrentTime(int /*currentTime*/)
{
- if (!firstChild())
- return;
+ Q_ASSERT(firstChild());
for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
if (animation->state() == state()) {
@@ -81,6 +80,10 @@ void QContinuingAnimationGroupJob::updateState(QAbstractAnimationJob::State newS
animation->pause();
break;
case Running:
+ if (!firstChild()) {
+ stop();
+ return;
+ }
for (QAbstractAnimationJob *animation = firstChild(); animation; animation = animation->nextSibling()) {
resetUncontrolledAnimationFinishTime(animation);
animation->setDirection(m_direction);