From a271b18c0984722f435cda0648239c0c32b3251c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 27 Nov 2017 17:26:43 +0200 Subject: [PATCH] Take ownership of any floating references in Bin::add/remove_element() --- gst-plugin/src/bin.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gst-plugin/src/bin.rs b/gst-plugin/src/bin.rs index 7e73cccb..4def3c1f 100644 --- a/gst-plugin/src/bin.rs +++ b/gst-plugin/src/bin.rs @@ -161,13 +161,12 @@ where { callback_guard!(); floating_reference_guard!(ptr); - floating_reference_guard!(element); let bin = &*(ptr as *mut InstanceStruct); let wrap: T = from_glib_borrow(ptr as *mut InstanceStruct); 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); let wrap: T = from_glib_borrow(ptr as *mut InstanceStruct); 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() }