We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5e1669 commit 248a6f9Copy full SHA for 248a6f9
src/call_client.rs
@@ -768,10 +768,13 @@ impl Drop for PyCallClient {
768
// GIL acquired
769
fn drop(&mut self) {
770
unsafe {
771
- // Cleanup delegates so they are not called during destroy.
772
- let mut delegates = self.inner.delegates.lock().unwrap();
773
- delegates.on_event.take();
774
- delegates.on_video_frame.take();
+ {
+ // Cleanup delegates so they are not called during destroy. Do
+ // it inside a new scope so the lock gets released.
+ let mut delegates = self.inner.delegates.lock().unwrap();
775
+ delegates.on_event.take();
776
+ delegates.on_video_frame.take();
777
+ }
778
779
let mut call_client = self.call_client.clone();
780
0 commit comments