timeline: Fix infinite loop on dispose
authorThibault Saunier <tsaunier@gnome.org>
Wed, 6 Jan 2016 17:14:07 +0000 (18:14 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Sun, 17 Jan 2016 08:23:37 +0000 (09:23 +0100)
Reviewed-by: Thibault Saunier <thibault.saunier@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D628

ges/ges-timeline.c

index 1c805b437f8f619c513e4e1f7348d153d75a5bc0..ff7559e88769bfa1f565787d6e55082b50bbd407 100644 (file)
@@ -338,6 +338,7 @@ ges_timeline_dispose (GObject * object)
 {
   GESTimeline *tl = GES_TIMELINE (object);
   GESTimelinePrivate *priv = tl->priv;
+  GList *tmp;
 
   while (tl->layers) {
     GESLayer *layer = (GESLayer *) tl->layers->data;
@@ -352,10 +353,12 @@ ges_timeline_dispose (GObject * object)
   while (tl->tracks)
     ges_timeline_remove_track (GES_TIMELINE (object), tl->tracks->data);
 
-  while (priv->groups)
-    g_list_free_full (ges_container_ungroup (priv->groups->data, FALSE),
+  for (tmp = priv->groups; tmp; tmp = tmp->next)
+    g_list_free_full (ges_container_ungroup (tmp->data, FALSE),
         gst_object_unref);
 
+  g_list_free (priv->groups);
+
   g_hash_table_unref (priv->by_start);
   g_hash_table_unref (priv->by_end);
   g_hash_table_unref (priv->by_object);