mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-12-23 08:36:31 +00:00
gstreamer/device: Preserve floating reference flag from create_element() parent class' implementation
This commit is contained in:
parent
84ac2ef073
commit
bef1143df3
1 changed files with 4 additions and 1 deletions
|
@ -46,7 +46,10 @@ impl<T: DeviceImpl + ObjectImpl> DeviceImplExt for T {
|
|||
let data = self.get_type_data();
|
||||
let parent_class = data.as_ref().get_parent_class() as *mut gst_sys::GstDeviceClass;
|
||||
if let Some(f) = (*parent_class).create_element {
|
||||
from_glib_none(f(device.to_glib_none().0, name.to_glib_none().0))
|
||||
let ptr = f(device.to_glib_none().0, name.to_glib_none().0);
|
||||
|
||||
// Don't steal floating reference here but pass it further to the caller
|
||||
from_glib_full(ptr)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue