forked from mirrors/gstreamer-rs
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/1447>
This commit is contained in:
parent
bc4908eead
commit
93348efcbf
1 changed files with 14 additions and 1 deletions
|
@ -2823,7 +2823,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)
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -3037,4 +3037,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