GESTimelineLayer: Release all layer/tracks when being disposed
authorEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 9 Jun 2010 11:52:08 +0000 (13:52 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 9 Jun 2010 11:52:08 +0000 (13:52 +0200)
ges/ges-timeline-layer.c

index d4b06da4312032912f9278a304b4f962419a38db..037cbfcece80765b4079d02aaac1f50d5a6100d0 100644 (file)
@@ -85,11 +85,13 @@ ges_timeline_layer_dispose (GObject * object)
 {
   GESTimelineLayer *layer = GES_TIMELINE_LAYER (object);
 
-  if (layer->objects_start) {
-    g_slist_foreach (layer->objects_start, (GFunc) g_object_unref, NULL);
-    g_slist_free (layer->objects_start);
-    layer->objects_start = NULL;
+  GST_DEBUG ("Disposing layer");
+
+  while (layer->objects_start) {
+    GESTimelineObject *obj = (GESTimelineObject *) layer->objects_start->data;
+    ges_timeline_layer_remove_object (layer, obj);
   }
+
   G_OBJECT_CLASS (ges_timeline_layer_parent_class)->dispose (object);
 }