mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
functional.h: acquire GIL before calling Python function
This commit is contained in:
parent
2f6662e174
commit
17b10d7cbf
@ -24,6 +24,7 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
object src(src_, true);
|
object src(src_, true);
|
||||||
value = [src](Args... args) -> Return {
|
value = [src](Args... args) -> Return {
|
||||||
|
gil_scoped_acquire acq;
|
||||||
object retval(src.call(std::move(args)...));
|
object retval(src.call(std::move(args)...));
|
||||||
/* Visual studio 2015 parser issue: need parentheses around this expression */
|
/* Visual studio 2015 parser issue: need parentheses around this expression */
|
||||||
return (retval.template cast<Return>());
|
return (retval.template cast<Return>());
|
||||||
|
Loading…
Reference in New Issue
Block a user