summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/widgets/styles/qcommonstyle.cpp10
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 */