fix possible crash in destructor of FeaturePythonPyT template
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#define APP_FEATUREPYTHONPYIMP_H
|
||||
|
||||
#include <Base/BaseClass.h>
|
||||
#include <Base/Interpreter.h>
|
||||
#include <App/PropertyContainerPy.h>
|
||||
|
||||
#define PYTHON_TYPE_DEF(_class_, _subclass_) \
|
||||
|
||||
@@ -84,12 +84,14 @@ template<class FeaturePyT>
|
||||
FeaturePythonPyT<FeaturePyT>::FeaturePythonPyT(Base::BaseClass *pcObject, PyTypeObject *T)
|
||||
: FeaturePyT(reinterpret_cast<typename FeaturePyT::PointerType>(pcObject), T)
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
dict_methods = PyDict_New();
|
||||
}
|
||||
|
||||
template<class FeaturePyT>
|
||||
FeaturePythonPyT<FeaturePyT>::~FeaturePythonPyT()
|
||||
{
|
||||
Base::PyGILStateLocker lock;
|
||||
Py_DECREF(dict_methods);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user