mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-22 09:31:06 +00:00
event: Fix leak in SelectStreamsBuilder
gst_event_new_select_streams() does not take ownership of GList Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1442>
This commit is contained in:
parent
b468280353
commit
f59029b57c
1 changed files with 14 additions and 1 deletions
|
@ -2910,7 +2910,7 @@ impl<'a> SelectStreamsBuilder<'a> {
|
|||
}
|
||||
|
||||
event_builder_generic_impl!(|s: &Self| {
|
||||
ffi::gst_event_new_select_streams(s.streams.to_glib_full())
|
||||
ffi::gst_event_new_select_streams(s.streams.to_glib_none().0)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3124,4 +3124,17 @@ mod tests {
|
|||
|
||||
assert_eq!(&*caps, caps2);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_select_streams() {
|
||||
crate::init().unwrap();
|
||||
|
||||
let s = ["foo", "bar"].to_vec();
|
||||
let event = crate::event::SelectStreams::new(&s);
|
||||
let streams = match event.view() {
|
||||
EventView::SelectStreams(streams) => streams.streams(),
|
||||
_ => unreachable!(),
|
||||
};
|
||||
assert_eq!(streams, s);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue