mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-15 22:11:01 +00:00
examples: play: Set message bus to flushing before dropping the Play
reference
Otherwise there might be pending messages on the bus that keep a reference to the `Play` instance alive, and neither the bus nor the `Play` are ever going to be freed then. See also https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/489 and https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3107. Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/493 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/merge_requests/1366>
This commit is contained in:
parent
70ee948623
commit
fc3fb363e7
1 changed files with 5 additions and 0 deletions
|
@ -37,6 +37,11 @@ fn main_loop(uri: &str) -> Result<(), Error> {
|
|||
Err(_) => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
// Set the message bus to flushing to ensure that all pending messages are dropped and there
|
||||
// are no further references to the play instance.
|
||||
play.message_bus().set_flushing(true);
|
||||
|
||||
result.map_err(|e| e.into())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue