Commit e6f65a50 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵 Committed by Sebastian Dröge

gstreamer/miniobject: ToOwned::to_owned() on references has to create a copy

Otherwise it's possible to create a new owned reference from a mutable
reference, and then there is a mutable and immutable reference to the
same data at the same time, which is simply not allowed.

#204
parent c766f164
......@@ -855,10 +855,7 @@ macro_rules! gst_define_mini_object_wrapper(
type Owned = $name;
fn to_owned(&self) -> $name {
#[allow(clippy::cast_ptr_alignment)]
unsafe {
$name($crate::glib::translate::from_glib_none($crate::miniobject::MiniObject::as_ptr(self)))
}
self.copy()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment