From 12775b817f4e9f9053b4ea677910dd4101971959 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 19 Dec 2012 13:36:41 +0100 Subject: Style animations: fix QCommonStylePrivate::stopAnimation() Explicitly delete animations, and remove the check for stopped state as that is already done by QAbstractAnimation::stop() and we want to delete the animation regardless of the current state. Task-number: QTBUG-28506 Change-Id: I3e34316e5077a8627ff5e6d3babd1873bbbaa774 Reviewed-by: Jens Bache-Wiig --- src/widgets/styles/qcommonstyle.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/widgets') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index a7b7edbc33..e7d2ac4961 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1156,8 +1156,10 @@ void QCommonStylePrivate::startAnimation(QStyleAnimation *animation) const void QCommonStylePrivate::stopAnimation(const QObject *target) const { QStyleAnimation *animation = animations.take(target); - if (animation && animation->state() != QAbstractAnimation::Stopped) + if (animation) { animation->stop(); + delete animation; + } } /*! \internal */ -- cgit v1.2.3