diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-03-31 15:38:36 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-04-04 15:45:49 +0200 |
commit | b02eeeee586abe343b8866385c1327ac009b3ef0 (patch) | |
tree | 46174b866e26ddeb2ad7ea8092ff988895850df1 | |
parent | 82e4ee03918a8abef4479ae67f259bfae4e6b79c (diff) |
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 <michael.brasser@live.com>
-rw-r--r-- | src/qml/animations/qabstractanimationjob.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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 |