mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-11-29 23:11:01 +00:00
Take ownership of any floating references in Bin::add/remove_element()
This commit is contained in:
parent
3f1eb96da9
commit
a271b18c09
1 changed files with 2 additions and 4 deletions
|
@ -161,13 +161,12 @@ where
|
|||
{
|
||||
callback_guard!();
|
||||
floating_reference_guard!(ptr);
|
||||
floating_reference_guard!(element);
|
||||
let bin = &*(ptr as *mut InstanceStruct<T>);
|
||||
let wrap: T = from_glib_borrow(ptr as *mut InstanceStruct<T>);
|
||||
let imp = &*bin.imp;
|
||||
|
||||
panic_to_error!(&wrap, &bin.panicked, false, {
|
||||
imp.add_element(&wrap, &from_glib_borrow(element))
|
||||
imp.add_element(&wrap, &from_glib_none(element))
|
||||
}).to_glib()
|
||||
}
|
||||
|
||||
|
@ -180,13 +179,12 @@ where
|
|||
{
|
||||
callback_guard!();
|
||||
floating_reference_guard!(ptr);
|
||||
floating_reference_guard!(element);
|
||||
let bin = &*(ptr as *mut InstanceStruct<T>);
|
||||
let wrap: T = from_glib_borrow(ptr as *mut InstanceStruct<T>);
|
||||
let imp = &*bin.imp;
|
||||
|
||||
panic_to_error!(&wrap, &bin.panicked, false, {
|
||||
imp.remove_element(&wrap, &from_glib_borrow(element))
|
||||
imp.remove_element(&wrap, &from_glib_none(element))
|
||||
}).to_glib()
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue