summaryrefslogtreecommitdiffstats
path: root/src/corelib/animation
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-10-20 11:20:31 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-10-20 11:20:31 (GMT)
commite64b5fa1312f42fa6377e28c11f8aa3a3413280f (patch)
tree3bd10964112cc44be9bd55f663ea3914277c874b /src/corelib/animation
parente0aeecfa8cc41a476bef070b349683be9aec2243 (diff)
downloadQt-e64b5fa1312f42fa6377e28c11f8aa3a3413280f.zip
Qt-e64b5fa1312f42fa6377e28c11f8aa3a3413280f.tar.gz
Qt-e64b5fa1312f42fa6377e28c11f8aa3a3413280f.tar.bz2
Fixed a bug in that could unregister not-registered animations
Diffstat (limited to 'src/corelib/animation')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index e83fad7..0d5f278 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -278,11 +278,11 @@ void QUnifiedTimer::registerAnimation(QAbstractAnimation *animation, bool isTopL
void QUnifiedTimer::unregisterAnimation(QAbstractAnimation *animation)
{
- unregisterRunningAnimation(animation);
-
if (!QAbstractAnimationPrivate::get(animation)->hasRegisteredTimer)
return;
+ unregisterRunningAnimation(animation);
+
int idx = animations.indexOf(animation);
if (idx != -1) {
animations.removeAt(idx);
@@ -318,6 +318,7 @@ void QUnifiedTimer::unregisterRunningAnimation(QAbstractAnimation *animation)
runningPauseAnimations.removeOne(animation);
else
runningLeafAnimations--;
+ Q_ASSERT(runningLeafAnimations >= 0);
}
int QUnifiedTimer::closestPauseAnimationTimeToFinish()