gstreamer/element: Use from_glib_none() for the release_pad() trampoline

The reference to the pad we get passed is not guaranteed to be valid for
the whole scope of release_pad(). It might be the last reference as
owned by GstElement, and gst_element_remove_pad() would destroy it then.
This commit is contained in:
Sebastian Dröge 2019-08-14 11:58:05 +03:00
parent ec3a11cec1
commit 2ead2e60eb

View file

@ -373,7 +373,7 @@ unsafe extern "C" fn element_release_pad<T: ObjectSubclass>(
let wrap: Element = from_glib_borrow(ptr);
gst_panic_to_error!(&wrap, &instance.panicked(), (), {
imp.release_pad(&wrap, &from_glib_borrow(pad))
imp.release_pad(&wrap, &from_glib_none(pad))
})
}