From e00781309b4129725439f02e856db77ef3d49843 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 14 Aug 2019 11:58:05 +0300 Subject: [PATCH] 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. --- gstreamer/src/subclass/element.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gstreamer/src/subclass/element.rs b/gstreamer/src/subclass/element.rs index c26b0fccc..89552f6ab 100644 --- a/gstreamer/src/subclass/element.rs +++ b/gstreamer/src/subclass/element.rs @@ -373,7 +373,7 @@ unsafe extern "C" fn element_release_pad( 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)) }) }