fix crash with Py3 when releasing memory buffer

This commit is contained in:
wmayer
2018-10-27 19:58:54 +02:00
parent 3b1e1f8859
commit b6712e264a
2 changed files with 2 additions and 0 deletions

View File

@@ -63,6 +63,7 @@ DocumentObject::DocumentObject(void)
DocumentObject::~DocumentObject(void)
{
if (!PythonObject.is(Py::_None())){
Base::PyGILStateLocker lock;
// Remark: The API of Py::Object has been changed to set whether the wrapper owns the passed
// Python object or not. In the constructor we forced the wrapper to own the object so we need
// not to dec'ref the Python object any more.