diff --git a/src/runtime.rs b/src/runtime.rs index 74365440..114f2e45 100644 --- a/src/runtime.rs +++ b/src/runtime.rs @@ -206,7 +206,10 @@ where }, () = cancel_tx.notified() => { let _ = rb.run(move || { - Python::with_gil(|_| drop(aw)); + Python::with_gil(|_| { + drop(aw_ref); + drop(aw); + }); }); } }