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>
This commit is contained in:
J-P Nurmi 2012-12-19 13:36:41 +01:00 committed by The Qt Project
parent a3a4114f53
commit 12775b817f

View File

@ -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 */