fix crash with Py3 when releasing memory buffer

This commit is contained in:
wmayer
2018-10-29 11:59:34 +01:00
parent 42c5b2e9ca
commit 1e7aa1becf
2 changed files with 2 additions and 0 deletions

View File

@@ -210,6 +210,7 @@ Document::~Document()
delete it2->second;
// remove the reference from the object
Base::PyGILStateLocker lock;
_pcDocPy->setInvalid();
_pcDocPy->DecRef();
delete d;

View File

@@ -95,6 +95,7 @@ ViewProvider::ViewProvider()
ViewProvider::~ViewProvider()
{
if (pyViewObject) {
Base::PyGILStateLocker lock;
pyViewObject->setInvalid();
pyViewObject->DecRef();
}