summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2016-05-18 12:48:48 +0300
committerTim-Philipp Müller <tim@centricular.com>2016-06-03 00:51:32 +0100
commit007c7f9b7877d028a356258ecb826c61ba2f3fc9 (patch)
treed800f5c47aa2a9393904df7c4c773a0612355223 /sys
parentf615a84646ea581a5048f29a0c81a27917518767 (diff)
downloadgstreamer-plugins-bad-007c7f9b7877d028a356258ecb826c61ba2f3fc9.tar.gz
a2dpsink: unref avdtpsink if state transition failed
If for some reason the avdtpsink element can't go READY then the gsta2dpsink can't either and so should release the ressources it allocates when trying to do so. Fix a leak with the generic/states test. https://bugzilla.gnome.org/show_bug.cgi?id=767161
Diffstat (limited to 'sys')
-rw-r--r--sys/bluez/gsta2dpsink.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/bluez/gsta2dpsink.c b/sys/bluez/gsta2dpsink.c
index f252dc05b..a7ffd2939 100644
--- a/sys/bluez/gsta2dpsink.c
+++ b/sys/bluez/gsta2dpsink.c
@@ -288,6 +288,9 @@ gst_a2dp_sink_change_state (GstElement * element, GstStateChange transition)
self->autoconnect, NULL);
ret = gst_element_set_state (GST_ELEMENT (self->sink), GST_STATE_READY);
+ if (ret == GST_STATE_CHANGE_FAILURE) {
+ g_clear_object (&self->sink);
+ }
break;
default:
break;