diff --git a/net/webrtc/src/utils.rs b/net/webrtc/src/utils.rs index 12e2db27..33cfa3c1 100644 --- a/net/webrtc/src/utils.rs +++ b/net/webrtc/src/utils.rs @@ -127,6 +127,13 @@ where let (abort_handle, abort_registration) = future::AbortHandle::new_pair(); { let mut canceller_guard = canceller.lock().unwrap(); + if canceller_guard.is_some() { + return Err(WaitError::FutureError(gst::error_msg!( + gst::ResourceError::Failed, + ["Old Canceller should not exist"] + ))); + } + canceller_guard.replace(abort_handle); drop(canceller_guard); }