From: George Kiagiadakis Date: Thu, 6 Mar 2014 10:40:23 +0000 (+0200) Subject: ghostpad: hold a reference to the target pad while unlinking it X-Git-Tag: 1.3.1~124 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fc671e801c64d8ea329bf2a29485240db3f0bc3;p=platform%2Fupstream%2Fgstreamer.git ghostpad: hold a reference to the target pad while unlinking it https://bugzilla.gnome.org/show_bug.cgi?id=725809 --- diff --git a/gst/gstghostpad.c b/gst/gstghostpad.c index 98712d8..47e9dce 100644 --- a/gst/gstghostpad.c +++ b/gst/gstghostpad.c @@ -836,7 +836,7 @@ gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget) GST_DEBUG_OBJECT (gpad, "clearing target"); /* clear old target */ - if ((oldtarget = GST_PROXY_PAD_TARGET (gpad))) { + if ((oldtarget = gst_pad_get_peer (internal))) { GST_OBJECT_UNLOCK (gpad); /* unlink internal pad */ @@ -844,6 +844,8 @@ gst_ghost_pad_set_target (GstGhostPad * gpad, GstPad * newtarget) gst_pad_unlink (internal, oldtarget); else gst_pad_unlink (oldtarget, internal); + + gst_object_unref (oldtarget); } else { GST_OBJECT_UNLOCK (gpad); }