From a9960f1fc07f0baddc75a85d40cb8719d486a378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 24 Jun 2018 14:56:11 +0300 Subject: [PATCH] Get rid of callback_guard! as unwinding through FFI is defined behaviour now and aborts --- gst-plugin/src/base_sink.rs | 13 ------------- gst-plugin/src/base_src.rs | 15 --------------- gst-plugin/src/base_transform.rs | 13 ------------- gst-plugin/src/bin.rs | 3 --- gst-plugin/src/element.rs | 6 ------ gst-plugin/src/uri_handler.rs | 5 ----- 6 files changed, 55 deletions(-) diff --git a/gst-plugin/src/base_sink.rs b/gst-plugin/src/base_sink.rs index e40689c1..e7049037 100644 --- a/gst-plugin/src/base_sink.rs +++ b/gst-plugin/src/base_sink.rs @@ -311,7 +311,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -327,7 +326,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -344,7 +342,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -364,7 +361,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -384,7 +380,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -404,7 +399,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -424,7 +418,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -444,7 +437,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -463,7 +455,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -488,7 +479,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -508,7 +498,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -527,7 +516,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -543,7 +531,6 @@ where T::ImplType: BaseSinkImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); diff --git a/gst-plugin/src/base_src.rs b/gst-plugin/src/base_src.rs index 12ff3d6e..3f322925 100644 --- a/gst-plugin/src/base_src.rs +++ b/gst-plugin/src/base_src.rs @@ -383,7 +383,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -399,7 +398,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -415,7 +413,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -434,7 +431,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -461,7 +457,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -483,7 +478,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -511,7 +505,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -530,7 +523,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -550,7 +542,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -569,7 +560,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -593,7 +583,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -610,7 +599,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -630,7 +618,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -649,7 +636,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -665,7 +651,6 @@ where T::ImplType: BaseSrcImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); diff --git a/gst-plugin/src/base_transform.rs b/gst-plugin/src/base_transform.rs index fecb1d42..e8d84091 100644 --- a/gst-plugin/src/base_transform.rs +++ b/gst-plugin/src/base_transform.rs @@ -444,7 +444,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -460,7 +459,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -479,7 +477,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -511,7 +508,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -536,7 +532,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -556,7 +551,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -576,7 +570,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -604,7 +597,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -636,7 +628,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -661,7 +652,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -680,7 +670,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -700,7 +689,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -723,7 +711,6 @@ where T::ImplType: BaseTransformImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); diff --git a/gst-plugin/src/bin.rs b/gst-plugin/src/bin.rs index 35c42af1..91e9b4ff 100644 --- a/gst-plugin/src/bin.rs +++ b/gst-plugin/src/bin.rs @@ -166,7 +166,6 @@ where T::ImplType: BinImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let bin = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -185,7 +184,6 @@ where T::ImplType: BinImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let bin = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -203,7 +201,6 @@ unsafe extern "C" fn bin_handle_message( T::ImplType: BinImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let bin = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); diff --git a/gst-plugin/src/element.rs b/gst-plugin/src/element.rs index 6db791c7..663e6b87 100644 --- a/gst-plugin/src/element.rs +++ b/gst-plugin/src/element.rs @@ -282,7 +282,6 @@ where T::ImplType: ElementImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -313,7 +312,6 @@ where T::ImplType: ElementImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -350,7 +348,6 @@ unsafe extern "C" fn element_release_pad( T::ImplType: ElementImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -369,7 +366,6 @@ where T::ImplType: ElementImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -388,7 +384,6 @@ where T::ImplType: ElementImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); @@ -407,7 +402,6 @@ unsafe extern "C" fn element_set_context( T::ImplType: ElementImpl, T::InstanceStructType: PanicPoison, { - callback_guard!(); floating_reference_guard!(ptr); let element = &*(ptr as *mut T::InstanceStructType); let wrap: T = from_glib_borrow(ptr as *mut T::InstanceStructType); diff --git a/gst-plugin/src/uri_handler.rs b/gst-plugin/src/uri_handler.rs index 7873bd16..49d4ff96 100644 --- a/gst-plugin/src/uri_handler.rs +++ b/gst-plugin/src/uri_handler.rs @@ -40,7 +40,6 @@ struct URIHandlerStatic { unsafe extern "C" fn uri_handler_get_type( type_: glib_ffi::GType, ) -> gst_ffi::GstURIType { - callback_guard!(); let klass = gobject_ffi::g_type_class_peek(type_); let klass = &*(klass as *const ClassStruct); let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) @@ -51,7 +50,6 @@ unsafe extern "C" fn uri_handler_get_type( unsafe extern "C" fn uri_handler_get_protocols( type_: glib_ffi::GType, ) -> *const *const libc::c_char { - callback_guard!(); let klass = gobject_ffi::g_type_class_peek(type_); let klass = &*(klass as *const ClassStruct); let interface_static = klass.get_interface_static(gst_ffi::gst_uri_handler_get_type()) @@ -62,7 +60,6 @@ unsafe extern "C" fn uri_handler_get_protocols( unsafe extern "C" fn uri_handler_get_uri( uri_handler: *mut gst_ffi::GstURIHandler, ) -> *mut libc::c_char { - callback_guard!(); floating_reference_guard!(uri_handler); let klass = &**(uri_handler as *const *const ClassStruct); @@ -81,7 +78,6 @@ unsafe extern "C" fn uri_handler_set_uri( uri: *const libc::c_char, err: *mut *mut glib_ffi::GError, ) -> glib_ffi::gboolean { - callback_guard!(); floating_reference_guard!(uri_handler); let klass = &**(uri_handler as *const *const ClassStruct); @@ -105,7 +101,6 @@ unsafe extern "C" fn uri_handler_init( iface: glib_ffi::gpointer, iface_data: glib_ffi::gpointer, ) { - callback_guard!(); let uri_handler_iface = &mut *(iface as *mut gst_ffi::GstURIHandlerInterface); let iface_type = (*(iface as *const gobject_ffi::GTypeInterface)).g_type;