From 823a8d593ffb2c9af27235e41f5e8efebf836ab3 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 5 Oct 2023 16:28:18 +0200 Subject: [PATCH] Gui: when closing application remove all manipulators --- src/Gui/Application.cpp | 2 ++ src/Gui/WorkbenchManipulator.cpp | 5 +++++ src/Gui/WorkbenchManipulator.h | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/src/Gui/Application.cpp b/src/Gui/Application.cpp index 0e62bc16d1..f1d4255f32 100644 --- a/src/Gui/Application.cpp +++ b/src/Gui/Application.cpp @@ -126,6 +126,7 @@ #include "WaitCursor.h" #include "Workbench.h" #include "WorkbenchManager.h" +#include "WorkbenchManipulator.h" #include "WidgetFactory.h" @@ -537,6 +538,7 @@ Application::~Application() { Base::Console().Log("Destruct Gui::Application\n"); WorkbenchManager::destruct(); + WorkbenchManipulator::removeAll(); SelectionSingleton::destruct(); Translator::destruct(); WidgetFactorySupplier::destruct(); diff --git a/src/Gui/WorkbenchManipulator.cpp b/src/Gui/WorkbenchManipulator.cpp index b266dfce92..560a9e2ad5 100644 --- a/src/Gui/WorkbenchManipulator.cpp +++ b/src/Gui/WorkbenchManipulator.cpp @@ -42,6 +42,11 @@ void WorkbenchManipulator::removeManipulator(const WorkbenchManipulator::Ptr& pt } } +void WorkbenchManipulator::removeAll() +{ + manipulators.clear(); +} + std::set WorkbenchManipulator::getManipulators() { return manipulators; diff --git a/src/Gui/WorkbenchManipulator.h b/src/Gui/WorkbenchManipulator.h index 97865d2701..c7995d044c 100644 --- a/src/Gui/WorkbenchManipulator.h +++ b/src/Gui/WorkbenchManipulator.h @@ -58,6 +58,11 @@ public: * Removes an installed instance of WorkbenchManipulator */ static void removeManipulator(const WorkbenchManipulator::Ptr&); + /*! + * \brief clear + * Removes all instances of WorkbenchManipulator + */ + static void removeAll(); /*! * \brief changeMenuBar * Calls \ref modifyMenuBar for every installed WorkbenchManipulator