mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 01:21:05 +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/1219>
This commit is contained in:
parent
6ffb1db482
commit
f0bb4e5bef
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