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