App/Gui: fix possible crash when destroying Python feature or its view provider

This commit is contained in:
wmayer
2021-02-17 12:00:38 +01:00
parent 90b970ab4f
commit bb73b571f7
2 changed files with 10 additions and 0 deletions

View File

@@ -45,6 +45,11 @@ FeaturePythonImp::FeaturePythonImp(App::DocumentObject* o)
FeaturePythonImp::~FeaturePythonImp()
{
Base::PyGILStateLocker lock;
#undef FC_PY_ELEMENT
#define FC_PY_ELEMENT(_name) py_##_name = Py::None();
FC_PY_FEATURE_PYTHON
}
void FeaturePythonImp::init(PyObject *pyobj) {