App/Gui: fix possible crash when destroying Python feature or its view provider
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user