mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 07:28:53 +00:00
videorecordingbin: Fix leaks
This commit is contained in:
parent
6e4efe5ad4
commit
1ff89c5f83
1 changed files with 7 additions and 2 deletions
|
@ -210,9 +210,12 @@ static void
|
||||||
gst_video_recording_bin_init (GstVideoRecordingBin * videobin,
|
gst_video_recording_bin_init (GstVideoRecordingBin * videobin,
|
||||||
GstVideoRecordingBinClass * videobin_class)
|
GstVideoRecordingBinClass * videobin_class)
|
||||||
{
|
{
|
||||||
|
GstPadTemplate *templ;
|
||||||
|
|
||||||
|
templ = gst_static_pad_template_get (&sink_template);
|
||||||
videobin->ghostpad =
|
videobin->ghostpad =
|
||||||
gst_ghost_pad_new_no_target_from_template ("sink",
|
gst_ghost_pad_new_no_target_from_template ("sink", templ);
|
||||||
gst_static_pad_template_get (&sink_template));
|
gst_object_unref (templ);
|
||||||
gst_element_add_pad (GST_ELEMENT_CAST (videobin), videobin->ghostpad);
|
gst_element_add_pad (GST_ELEMENT_CAST (videobin), videobin->ghostpad);
|
||||||
|
|
||||||
videobin->location = g_strdup (DEFAULT_LOCATION);
|
videobin->location = g_strdup (DEFAULT_LOCATION);
|
||||||
|
@ -307,6 +310,8 @@ gst_video_recording_bin_create_elements (GstVideoRecordingBin * videobin)
|
||||||
pad = gst_element_get_static_pad (colorspace, "sink");
|
pad = gst_element_get_static_pad (colorspace, "sink");
|
||||||
if (!gst_ghost_pad_set_target (GST_GHOST_PAD (videobin->ghostpad), pad))
|
if (!gst_ghost_pad_set_target (GST_GHOST_PAD (videobin->ghostpad), pad))
|
||||||
goto error;
|
goto error;
|
||||||
|
gst_object_unref (pad);
|
||||||
|
pad = NULL;
|
||||||
|
|
||||||
videobin->elements_created = TRUE;
|
videobin->elements_created = TRUE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in a new issue