mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-25 11:01:10 +00:00
video: Don't leak the gst::Buffer
when converting a VideoFrame
into an ffi::GstVideoFrame
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1220>
This commit is contained in:
parent
bc3e1404d6
commit
d1cc1b6715
1 changed files with 5 additions and 1 deletions
|
@ -283,7 +283,11 @@ impl<T> VideoFrame<T> {
|
|||
|
||||
#[inline]
|
||||
pub fn into_raw(self) -> ffi::GstVideoFrame {
|
||||
mem::ManuallyDrop::new(self).frame
|
||||
unsafe {
|
||||
let mut s = mem::ManuallyDrop::new(self);
|
||||
ptr::drop_in_place(&mut s.buffer);
|
||||
s.frame
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue