diff --git a/src/Mod/Fem/Gui/TaskFemConstraint.h b/src/Mod/Fem/Gui/TaskFemConstraint.h index 2dab3c55d0..2474347fbe 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraint.h +++ b/src/Mod/Fem/Gui/TaskFemConstraint.h @@ -25,9 +25,10 @@ #ifndef GUI_TASKVIEW_TaskFemConstraint_H #define GUI_TASKVIEW_TaskFemConstraint_H -#include +#include #include #include +#include #include "ViewProviderFemConstraint.h" @@ -69,7 +70,7 @@ protected: protected: QWidget* proxy; QAction* deleteAction; - ViewProviderFemConstraint *ConstraintView; + Gui::WeakPtrT ConstraintView; enum {seldir, selref, selloc, selnone} selectionMode; private: diff --git a/src/Mod/Fem/Gui/TaskFemConstraintOnBoundary.cpp b/src/Mod/Fem/Gui/TaskFemConstraintOnBoundary.cpp index b85f91db73..a57fca6e4b 100644 --- a/src/Mod/Fem/Gui/TaskFemConstraintOnBoundary.cpp +++ b/src/Mod/Fem/Gui/TaskFemConstraintOnBoundary.cpp @@ -39,7 +39,8 @@ TaskFemConstraintOnBoundary::TaskFemConstraintOnBoundary(ViewProviderFemConstrai TaskFemConstraintOnBoundary::~TaskFemConstraintOnBoundary() { - ConstraintView->highlightReferences(false); + if (!ConstraintView.expired()) + ConstraintView->highlightReferences(false); } void TaskFemConstraintOnBoundary::_addToSelection(bool checked)