From bb41cb54cbdbb21f3be26ac14c07fd1c804b4d31 Mon Sep 17 00:00:00 2001 From: Chris Lord Date: Tue, 18 Jan 2011 15:48:29 +0000 Subject: [PATCH] timeline: Check if the timeline is playing in do_tick Check that the timeline is still playing before executing in _clutter_timeline_do_tick. This fixes the possibility of receiving a new-frame signal when stopping a timeline in response to a different timeline's signal emission. --- clutter/clutter-timeline.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clutter/clutter-timeline.c b/clutter/clutter-timeline.c index e240cf2..165e2c5 100644 --- a/clutter/clutter-timeline.c +++ b/clutter/clutter-timeline.c @@ -1253,6 +1253,14 @@ _clutter_timeline_do_tick (ClutterTimeline *timeline, priv = timeline->priv; + /* Check the is_playing variable before performing the timeline tick. + * This is necessary, as if a timeline is stopped in response to a + * master-clock generated signal of a different timeline, this code can + * still be reached. + */ + if (!priv->is_playing) + return; + if (priv->waiting_first_tick) { priv->last_frame_time = tick_time; -- 2.7.4