Skip to content

Commit

Permalink
Hold GIL on PyFutureAwaitable cancel drops (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
gi0baro committed Jul 9, 2024
1 parent 72a9a21 commit 8332f65
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
}
}
Expand Down

0 comments on commit 8332f65

Please sign in to comment.