From f2f18ebb278f66f09995148cf9790ed469f6357f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 5 Apr 2018 12:14:27 +0300 Subject: [PATCH] Fix ElementImplExt::catch_panic_pad_function() to actually work --- gst-plugin/src/element.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst-plugin/src/element.rs b/gst-plugin/src/element.rs index 89917bb70..99dc26efd 100644 --- a/gst-plugin/src/element.rs +++ b/gst-plugin/src/element.rs @@ -70,8 +70,11 @@ impl, T: ObjectType + glib::IsA + glib::IsA R { + // FIXME: Does this work for element subclasses? let element = parent.as_ref().cloned().unwrap().downcast::().unwrap(); - let imp = Any::downcast_ref::(element.get_impl()).unwrap(); + let imp = element.get_impl(); + let imp = Any::downcast_ref:: + 'static>>(imp).unwrap(); + let imp = imp.downcast_ref::().unwrap(); element.catch_panic(fallback, |element| f(imp, element)) } }