playbin: fix suburidecodebin leak
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 16 May 2016 13:39:02 +0000 (15:39 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 17 May 2016 06:55:51 +0000 (09:55 +0300)
We take a ref before removing which was never freeded.
The element is still alive anyway because the group has its own ref as
well.

Fix a leak with the 'test_suburi_error_wrongproto' test.

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

gst/playback/gstplaybin2.c

index e939fa6..15fea65 100644 (file)
@@ -3017,6 +3017,7 @@ gst_play_bin_handle_message (GstBin * bin, GstMessage * msg)
         gst_object_ref (group->suburidecodebin);
         gst_bin_remove (bin, group->suburidecodebin);
         gst_element_set_locked_state (group->suburidecodebin, FALSE);
+        gst_object_unref (group->suburidecodebin);
 
         GST_SOURCE_GROUP_LOCK (group);
         g_free (group->suburi);