From b02eeeee586abe343b8866385c1327ac009b3ef0 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Mon, 31 Mar 2014 15:38:36 +0200 Subject: Stop the animation driver when no animations are ticking. When animations were registered we made a queued connection to 'startAnimations' to start the animation driver and also set the 'startAnimationPending' state to true. In 'stopTimer' we aborted if 'startAnimationPending' was true, presumeably to avoid stopping just to restart shortly after. However, if an animation is registered which triggers the invoke and then is immediately removed again, 'startAnimationPending' will be true with no pending animations at the time of 'stopTimer'. As a result, the driver would not stop and the system would continue animating and trying to render. Change-Id: Icbb01d7129c3a1bddef08a9f2a7aee957e3d2909 Reviewed-by: Michael Brasser --- src/qml/animations/qabstractanimationjob.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/qml/animations/qabstractanimationjob.cpp b/src/qml/animations/qabstractanimationjob.cpp index 7fd72d97d2..b6222a541c 100644 --- a/src/qml/animations/qabstractanimationjob.cpp +++ b/src/qml/animations/qabstractanimationjob.cpp @@ -153,7 +153,8 @@ void QQmlAnimationTimer::startAnimations() void QQmlAnimationTimer::stopTimer() { stopTimerPending = false; - if (animations.isEmpty() && !startAnimationPending) { + bool pendingStart = startAnimationPending && animationsToStart.size() > 0; + if (animations.isEmpty() && !pendingStart) { QUnifiedTimer::resumeAnimationTimer(this); QUnifiedTimer::stopAnimationTimer(this); // invalidate the start reference time -- cgit v1.2.3