diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-24 21:55:04 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2012-02-27 15:46:44 +0800 |
commit | ed191caba6658b580db78a1802f2c8293e4564fb (patch) | |
tree | 4cf418bfa5b7e668d2094d5fd10007f8eaa2d32c /src | |
parent | e790a2faa4d607cd812d6babe22b0078ba5906d4 (diff) | |
download | gsoc2013-empathy-ed191caba6658b580db78a1802f2c8293e4564fb.tar gsoc2013-empathy-ed191caba6658b580db78a1802f2c8293e4564fb.tar.gz gsoc2013-empathy-ed191caba6658b580db78a1802f2c8293e4564fb.tar.bz2 gsoc2013-empathy-ed191caba6658b580db78a1802f2c8293e4564fb.tar.lz gsoc2013-empathy-ed191caba6658b580db78a1802f2c8293e4564fb.tar.xz gsoc2013-empathy-ed191caba6658b580db78a1802f2c8293e4564fb.tar.zst gsoc2013-empathy-ed191caba6658b580db78a1802f2c8293e4564fb.zip |
audio-sink: fix GstPad leaks
gst_ghost_pad_new() doesn't take ownership of the target pad so we have to
unref it ourself.
https://bugzilla.gnome.org/show_bug.cgi?id=670745
Diffstat (limited to 'src')
-rw-r--r-- | src/empathy-audio-sink.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/empathy-audio-sink.c b/src/empathy-audio-sink.c index fbffa4885..b4680a0fb 100644 --- a/src/empathy-audio-sink.c +++ b/src/empathy-audio-sink.c @@ -301,7 +301,7 @@ empathy_audio_sink_request_new_pad (GstElement *element, EmpathyGstAudioSink *self = EMPATHY_GST_AUDIO_SINK (element); GstElement *bin, *resample, *audioconvert0, *audioconvert1; GstPad *pad = NULL; - GstPad *subpad, *filterpad; + GstPad *subpad = NULL, *filterpad; bin = gst_bin_new (NULL); @@ -355,6 +355,8 @@ empathy_audio_sink_request_new_pad (GstElement *element, goto error; subpad = gst_ghost_pad_new ("sink", filterpad); + gst_object_unref (filterpad); + if (!gst_element_add_pad (GST_ELEMENT (bin), subpad)) goto error; @@ -362,6 +364,7 @@ empathy_audio_sink_request_new_pad (GstElement *element, pad = gst_ghost_pad_new (name, subpad); g_assert (pad != NULL); + gst_object_unref (subpad); if (!gst_element_sync_state_with_parent (bin)) goto error; @@ -380,6 +383,8 @@ error: gst_object_unref (pad); } + tp_clear_pointer (&subpad, gst_object_unref); + gst_object_unref (bin); g_warning ("Failed to create output subpipeline"); return NULL; |