mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-14 13:31:09 +00:00
gstreamer/clock: Unschedule clock ID when the receiver end of the channel is disconnected
This commit is contained in:
parent
b4e8ace192
commit
2b87e5f51d
1 changed files with 4 additions and 1 deletions
|
@ -117,7 +117,10 @@ impl ClockId {
|
|||
let (sender, receiver) = mpsc::unbounded();
|
||||
|
||||
self.wait_async(move |_clock, jitter, id| {
|
||||
let _ = sender.unbounded_send((jitter, id.clone()));
|
||||
if sender.unbounded_send((jitter, id.clone())).is_err() {
|
||||
// Unschedule any future calls if the receiver end is disconnected
|
||||
id.unschedule();
|
||||
}
|
||||
})?;
|
||||
|
||||
Ok(Box::pin(receiver))
|
||||
|
|
Loading…
Reference in a new issue