mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-05 17:19:42 +00:00
Unref the message in sync bus handlers if Drop is returned
This commit is contained in:
parent
93b32882ee
commit
af5470a8b0
1 changed files with 7 additions and 1 deletions
|
@ -50,7 +50,13 @@ unsafe extern "C" fn trampoline_sync(
|
|||
) -> ffi::GstBusSyncReply {
|
||||
#[cfg_attr(feature = "cargo-clippy", allow(transmute_ptr_to_ref))]
|
||||
let f: &&(Fn(&Bus, &Message) -> BusSyncReply + Send + Sync + 'static) = transmute(func);
|
||||
f(&from_glib_borrow(bus), &Message::from_glib_borrow(msg)).to_glib()
|
||||
let res = f(&from_glib_borrow(bus), &Message::from_glib_borrow(msg)).to_glib();
|
||||
|
||||
if res == ffi::GST_BUS_DROP {
|
||||
ffi::gst_mini_object_unref(msg as *mut _);
|
||||
}
|
||||
|
||||
res
|
||||
}
|
||||
|
||||
unsafe extern "C" fn destroy_closure_sync(ptr: gpointer) {
|
||||
|
|
Loading…
Reference in a new issue