diff options
author | J-P Nurmi <jpnurmi@digia.com> | 2012-12-19 13:36:41 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-20 16:48:36 +0100 |
commit | 12775b817f4e9f9053b4ea677910dd4101971959 (patch) | |
tree | 395929ec33ce17bfbbeed37f75becf316406d593 /src/widgets/styles/qcommonstyle.cpp | |
parent | a3a4114f5377597a4641f1c21cac37453afdda9c (diff) |
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 <jens.bache-wiig@digia.com>
Diffstat (limited to 'src/widgets/styles/qcommonstyle.cpp')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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 */ |