From dca34854efc4ff10965794495d7e1d904321a447 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 30 Oct 2012 15:38:32 +0100 Subject: [PATCH] Fix QCommonStylePrivate::stopAnimation() Make sure that QCommonStylePrivate::animation() does not return an animation that was already stopped. Change-Id: I35b7f8e0fabff9908f247b3632e35388e2c95a6d Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 99ef88af00..2b6d843723 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1081,13 +1081,9 @@ void QCommonStylePrivate::startAnimation(QStyleAnimation *animation) const /*! \internal */ void QCommonStylePrivate::stopAnimation(const QObject *target) const { - QStyleAnimation *animation = animations.value(target); - if (animation) { - if (animation->state() == QAbstractAnimation::Stopped) - animations.take(target)->deleteLater(); - else - animation->stop(); - } + QStyleAnimation *animation = animations.take(target); + if (animation && animation->state() != QAbstractAnimation::Stopped) + animation->stop(); } /*! \internal */