Unref selector request pad even if we no longer have a selector.
authorMichael Smith <msmith@songbirdnest.com>
Sat, 31 Jan 2009 01:47:07 +0000 (17:47 -0800)
committerMichael Smith <msmith@songbirdnest.com>
Sat, 31 Jan 2009 02:30:10 +0000 (18:30 -0800)
During destruction, we won't have a selector any more, but we still need
to unref the pad to avoid leaking it.

gst/playback/gstplaybin2.c

index 1e1f31a..9189e21 100644 (file)
@@ -1835,8 +1835,10 @@ pad_removed_cb (GstElement * decodebin, GstPad * pad, GstSourceGroup * group)
   /* get selector, this can be NULL when the element is removing the pads
    * because it's being disposed. */
   selector = GST_ELEMENT_CAST (gst_pad_get_parent (peer));
-  if (!selector)
+  if (!selector) {
+    gst_object_unref (peer);
     goto no_selector;
+  }
 
   /* release the pad to the selector, this will make the selector choose a new
    * pad. */