diff options
author | Thierry Bastian <thierry.bastian@nokia.com> | 2009-10-20 11:20:31 (GMT) |
---|---|---|
committer | Thierry Bastian <thierry.bastian@nokia.com> | 2009-10-20 11:20:31 (GMT) |
commit | e64b5fa1312f42fa6377e28c11f8aa3a3413280f (patch) | |
tree | 3bd10964112cc44be9bd55f663ea3914277c874b /src | |
parent | e0aeecfa8cc41a476bef070b349683be9aec2243 (diff) | |
download | Qt-e64b5fa1312f42fa6377e28c11f8aa3a3413280f.zip Qt-e64b5fa1312f42fa6377e28c11f8aa3a3413280f.tar.gz Qt-e64b5fa1312f42fa6377e28c11f8aa3a3413280f.tar.bz2 |
Fixed a bug in that could unregister not-registered animations
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/animation/qabstractanimation.cpp | 5 |
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() |