diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2012-10-30 15:38:32 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-30 19:40:31 +0100 |
commit | dca34854efc4ff10965794495d7e1d904321a447 (patch) | |
tree | af8d2783e60980c7932a6320bc1a6a7ecab4a8e5 | |
parent | 85a8df184b3aaa7f3a5a35895aa1caa3d4c39f42 (diff) |
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 <jens.bache-wiig@digia.com>
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 10 |
1 files 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 */ |