From 84ac2ef073addc5cc57720c69eafc43ad442f857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 4 Dec 2019 18:49:12 +0200 Subject: [PATCH] bin: Use from_glib_none() in Bin::add() for subclasses This way we take ownership of any floating references passed in here, as required by the GstBin API, instead of just borrowing the reference and having someone else sink it or not. --- gstreamer/src/subclass/bin.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gstreamer/src/subclass/bin.rs b/gstreamer/src/subclass/bin.rs index cfb297c6f..6621f07a0 100644 --- a/gstreamer/src/subclass/bin.rs +++ b/gstreamer/src/subclass/bin.rs @@ -116,7 +116,7 @@ where let wrap: Bin = from_glib_borrow(ptr); gst_panic_to_error!(&wrap, &instance.panicked(), false, { - match imp.add_element(&wrap, &from_glib_borrow(element)) { + match imp.add_element(&wrap, &from_glib_none(element)) { Ok(()) => true, Err(err) => { err.log_with_object(&wrap);