From 17b10d7cbf64a372b120323bb5a987b9b3bd20e5 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Mon, 25 Apr 2016 09:17:28 +0200 Subject: [PATCH] functional.h: acquire GIL before calling Python function --- include/pybind11/functional.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/pybind11/functional.h b/include/pybind11/functional.h index 507483331..2d36c5f4b 100644 --- a/include/pybind11/functional.h +++ b/include/pybind11/functional.h @@ -24,6 +24,7 @@ public: return false; object src(src_, true); value = [src](Args... args) -> Return { + gil_scoped_acquire acq; object retval(src.call(std::move(args)...)); /* Visual studio 2015 parser issue: need parentheses around this expression */ return (retval.template cast());