diff --git a/src/Base/SmartPtrPy.cpp b/src/Base/SmartPtrPy.cpp index 5041d230e9..cd9757c929 100644 --- a/src/Base/SmartPtrPy.cpp +++ b/src/Base/SmartPtrPy.cpp @@ -26,6 +26,7 @@ #endif #include "SmartPtrPy.h" +#include "Interpreter.h" #include @@ -42,6 +43,7 @@ void SmartPtr::set(PyObject* pyob, bool owned) void SmartPtr::release() { + Base::PyGILStateLocker lock; Py::_XDECREF(p); p = nullptr; }