forked from mirrors/gstreamer-rs
gstreamer/element: Don't steal floating references passed into release_pad()
They are apparently not part of this element so we can directly return here instead of stealing the reference.
This commit is contained in:
parent
802fa4fcb4
commit
2375c9da59
1 changed files with 6 additions and 0 deletions
|
@ -420,6 +420,12 @@ unsafe extern "C" fn element_release_pad<T: ObjectSubclass>(
|
|||
let imp = instance.get_impl();
|
||||
let wrap: Element = from_glib_borrow(ptr);
|
||||
|
||||
// If we get a floating reference passed simply return here. It can't be stored inside this
|
||||
// element, and if we continued to use it we would take ownership of this floating reference.
|
||||
if gobject_sys::g_object_is_floating(pad as *mut gobject_sys::GObject) != glib_sys::GFALSE {
|
||||
return;
|
||||
}
|
||||
|
||||
gst_panic_to_error!(&wrap, &instance.panicked(), (), {
|
||||
imp.release_pad(&wrap, &from_glib_none(pad))
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue