A timeline advancement might cause another timeline to be
destroyed, which will likely lead to a segmentation fault.
Before advancing the timelines we should take a reference
on them - just like we do for the stages before doing
event processing. This will prevent dispose() from running
until the end of the advancement.
http://bugzilla.openedhand.com/show_bug.cgi?id=1854
g_return_if_fail (CLUTTER_IS_MASTER_CLOCK (master_clock));
+ /* we protect ourselves from timelines being removed during
+ * the advancement by other timelines
+ */
+ g_slist_foreach (master_clock->timelines, (GFunc) g_object_ref, NULL);
+
for (l = master_clock->timelines; l != NULL; l = next)
{
next = l->next;
clutter_timeline_do_tick (l->data, &master_clock->cur_tick);
}
+
+ g_slist_foreach (master_clock->timelines, (GFunc) g_object_unref, NULL);
}
/**