From 1e404bcb6df5127a1d0e24ed11cce1c0260a57e9 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Thu, 7 May 2009 09:17:37 +0200 Subject: store top-level animation in dedicated variable The animation itself is used by subsequent code, so we mustn't change it. --- src/corelib/statemachine/qstatemachine.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index 7f2132d..4533115 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -713,9 +713,10 @@ void QStateMachinePrivate::applyProperties(const QList &tr // Stop the (top-level) animation. // ### Stopping nested animation has weird behavior. - while (QAnimationGroup *group = anim->group()) - anim = group; - anim->stop(); + QAbstractAnimation *topLevelAnim = anim; + while (QAnimationGroup *group = topLevelAnim->group()) + topLevelAnim = group; + topLevelAnim->stop(); if (resetAnimationEndValues.contains(anim)) { qobject_cast(anim)->setEndValue(QVariant()); // ### generalize -- cgit v0.12