From 91acf022e97ecda51e5b4ecd8b0b946f74a3bfac Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 31 Mar 2014 13:47:26 +0200 Subject: 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 --- src/qml/animations/qcontinuinganimationgroupjob.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/qml/animations') 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); -- cgit v1.2.3