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 0814105 commit 9a4eb75Copy full SHA for 9a4eb75
include/pybind11/functional.h
@@ -60,8 +60,12 @@ struct type_caster<std::function<Return(Args...)>> {
60
func_handle(function&& f_) : f(std::move(f_)) {}
61
func_handle(const func_handle&) = default;
62
~func_handle() {
63
- gil_scoped_acquire acq;
64
- function kill_f(std::move(f));
+ PyGILState_STATE gstate;
+ gstate = PyGILState_Ensure();
65
+ {
66
+ function kill_f(std::move(f));
67
+ }
68
+ PyGILState_Release(gstate);
69
}
70
};
71
0 commit comments