From: Sebastian Dröge Date: Sun, 19 Dec 2010 11:05:11 +0000 (+0100) Subject: imagecapturebin: Don't leak pad template created from static pad template X-Git-Tag: RELEASE-0.10.21~172 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9605ff9aa8ebf7473d299555b5a20ee99b383db3;p=platform%2Fupstream%2Fgst-plugins-bad.git imagecapturebin: Don't leak pad template created from static pad template --- diff --git a/gst/camerabin2/gstimagecapturebin.c b/gst/camerabin2/gstimagecapturebin.c index 367232e..1ff5fe2 100644 --- a/gst/camerabin2/gstimagecapturebin.c +++ b/gst/camerabin2/gstimagecapturebin.c @@ -150,9 +150,13 @@ static void gst_image_capture_bin_init (GstImageCaptureBin * image_capturebin, GstImageCaptureBinClass * image_capturebin_class) { + GstPadTemplate *tmpl; + + tmpl = gst_static_pad_template_get (&sink_template); image_capturebin->ghostpad = - gst_ghost_pad_new_no_target_from_template ("sink", - gst_static_pad_template_get (&sink_template)); + gst_ghost_pad_new_no_target_from_template ("sink", tmpl); + gst_object_unref (tmpl); + gst_element_add_pad (GST_ELEMENT_CAST (image_capturebin), image_capturebin->ghostpad);