diff --git a/src/Gui/Selection/SelectionObserverPython.cpp b/src/Gui/Selection/SelectionObserverPython.cpp index 2d41f5c45a..a2434fa2f6 100644 --- a/src/Gui/Selection/SelectionObserverPython.cpp +++ b/src/Gui/Selection/SelectionObserverPython.cpp @@ -34,8 +34,6 @@ std::vector SelectionObserverPython::_instances; void SelectionObserverPythonHandler::init(PyObject* obj) { - this->inst = obj; - #undef FC_PY_ELEMENT #define FC_PY_ELEMENT(_name) FC_PY_GetCallable(obj,#_name,py_##_name); FC_PY_SEL_OBSERVER @@ -209,7 +207,7 @@ void SelectionObserverPythonHandler::removePreselection(const SelectionChanges& SelectionObserverPython::SelectionObserverPython(const Py::Object& obj, ResolveMode resolve) - : SelectionObserver(true, resolve) + : SelectionObserver(true, resolve), inst(obj) { this->init(obj.ptr()); } diff --git a/src/Gui/Selection/SelectionObserverPython.h b/src/Gui/Selection/SelectionObserverPython.h index 5eed3a217c..ea574464a1 100644 --- a/src/Gui/Selection/SelectionObserverPython.h +++ b/src/Gui/Selection/SelectionObserverPython.h @@ -52,8 +52,6 @@ protected: private: - PyObject* inst{nullptr}; - #define FC_PY_SEL_OBSERVER \ FC_PY_ELEMENT(onSelectionChanged) \ FC_PY_ELEMENT(addSelection) \