gstreamer/element: Don't catch panics in post_message() vfunc

Otherwise we would post a message, which calls into this code again and
then does the whole thing recursively forever.
This commit is contained in:
Sebastian Dröge 2020-07-01 01:36:16 +03:00
parent 4fbbf48622
commit 0cc32a02cc

View file

@ -550,10 +550,9 @@ where
let imp = instance.get_impl();
let wrap: Borrowed<Element> = from_glib_borrow(ptr);
gst_panic_to_error!(&wrap, &instance.panicked(), false, {
imp.post_message(&wrap, from_glib_full(msg))
})
.to_glib()
// Can't catch panics here as posting the error message would cause
// this code to be called again recursively forever.
imp.post_message(&wrap, from_glib_full(msg)).to_glib()
}
#[cfg(test)]