From b297490b2aba0b00aba616c749bef4648d6fdc1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 19 Dec 2010 12:09:41 +0100 Subject: [PATCH] imagecapturebin: Don't leak pad and sink --- gst/camerabin2/gstimagecapturebin.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/camerabin2/gstimagecapturebin.c b/gst/camerabin2/gstimagecapturebin.c index 1ff5fe2bce..8ee540f49f 100644 --- a/gst/camerabin2/gstimagecapturebin.c +++ b/gst/camerabin2/gstimagecapturebin.c @@ -192,7 +192,7 @@ gst_image_capture_bin_create_elements (GstImageCaptureBin * icbin) if (!sink) goto error; - icbin->sink = gst_object_ref (sink); + icbin->sink = sink; g_object_set (sink, "location", icbin->location, "async", FALSE, NULL); /* add and link */ @@ -204,6 +204,7 @@ gst_image_capture_bin_create_elements (GstImageCaptureBin * icbin) pad = gst_element_get_static_pad (csp, "sink"); if (!gst_ghost_pad_set_target (GST_GHOST_PAD (icbin->ghostpad), pad)) goto error; + gst_object_unref (pad); icbin->elements_created = TRUE; return TRUE;