rtpbin: fix leak of elements requested by signals
authorMathieu Duponchelle <mathieu@centricular.com>
Mon, 15 Jan 2018 17:13:37 +0000 (18:13 +0100)
committerMathieu Duponchelle <mathieu@centricular.com>
Thu, 18 Jan 2018 14:26:43 +0000 (15:26 +0100)
commit03dc22951bacb6fdc3868c8f801e6a52c33a745f
tree873f2e4ac6666a1d9de5ca8a1a7bcd16fdf2aff4
parentf7e280bf0d90b0ee2732ee5918115762889a3e88
rtpbin: fix leak of elements requested by signals

When the signal returns a floating reference, as its return type
is transfer full, we need to sink it ourselves before passing
it to gst_bin_add (which is transfer floating).

This allows us to unref it in bin_remove_element later on, and
thus to also release the reference we now own if the signal
returns a non-floating reference as well.

As we now still hold a reference to the element when removing it,
we also need to lock its state and setting it to NULL before
unreffing it

Also update the request_aux_sender test.

https://bugzilla.gnome.org/show_bug.cgi?id=792543
gst/rtpmanager/gstrtpbin.c
tests/check/elements/rtpbin.c