decodebin3: don't leak alternate inputs
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 28 Jul 2016 13:04:01 +0000 (15:04 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 4 Aug 2016 09:18:05 +0000 (11:18 +0200)
Fix leaks (including parsebin elements) with this pipeline:
playbin3
uri=http://127.0.0.1:8079/defaults/exMPD_BIP_TC1/exMPD_BIP_TC1.mpd

https://bugzilla.gnome.org/show_bug.cgi?id=769270

gst/playback/gstdecodebin3.c

index 34d1b02..6e45acf 100644 (file)
@@ -608,6 +608,7 @@ static void
 gst_decodebin3_dispose (GObject * object)
 {
   GstDecodebin3 *dbin = (GstDecodebin3 *) object;
+  GList *walk, *next;
 
   if (dbin->factories)
     gst_plugin_feature_list_free (dbin->factories);
@@ -622,7 +623,15 @@ gst_decodebin3_dispose (GObject * object)
   g_clear_object (&dbin->collection);
 
   free_input (dbin, dbin->main_input);
-  /* FIXME : GO OVER INPUTS */
+
+  for (walk = dbin->other_inputs; walk; walk = next) {
+    DecodebinInput *input = walk->data;
+
+    next = g_list_next (walk);
+
+    free_input (dbin, input);
+    dbin->other_inputs = g_list_delete_link (dbin->other_inputs, walk);
+  }
 
   G_OBJECT_CLASS (parent_class)->dispose (object);
 }