Get rid of callback_guard! as unwinding through FFI is defined behaviour now and aborts

This commit is contained in:
Sebastian Dröge 2018-06-24 14:56:11 +03:00
parent 754373ba6c
commit a9960f1fc0
6 changed files with 0 additions and 55 deletions

View file

@ -311,7 +311,6 @@ where
T::ImplType: BaseSinkImpl<T>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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);

View file

@ -383,7 +383,6 @@ where
T::ImplType: BaseSrcImpl<T>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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);

View file

@ -444,7 +444,6 @@ where
T::ImplType: BaseTransformImpl<T>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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>,
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);

View file

@ -166,7 +166,6 @@ where
T::ImplType: BinImpl<T>,
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>,
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: BinBase>(
T::ImplType: BinImpl<T>,
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);

View file

@ -282,7 +282,6 @@ where
T::ImplType: ElementImpl<T>,
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>,
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: ElementBase>(
T::ImplType: ElementImpl<T>,
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>,
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>,
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: ElementBase>(
T::ImplType: ElementImpl<T>,
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);

View file

@ -40,7 +40,6 @@ struct URIHandlerStatic<T: ObjectType> {
unsafe extern "C" fn uri_handler_get_type<T: ObjectType>(
type_: glib_ffi::GType,
) -> gst_ffi::GstURIType {
callback_guard!();
let klass = gobject_ffi::g_type_class_peek(type_);
let klass = &*(klass as *const ClassStruct<T>);
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<T: ObjectType>(
unsafe extern "C" fn uri_handler_get_protocols<T: ObjectType>(
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<T>);
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<T: ObjectType>(
unsafe extern "C" fn uri_handler_get_uri<T: ObjectType>(
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<T>);
@ -81,7 +78,6 @@ unsafe extern "C" fn uri_handler_set_uri<T: ObjectType>(
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<T>);
@ -105,7 +101,6 @@ unsafe extern "C" fn uri_handler_init<T: ObjectType>(
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;