From 580378899bea42f8ad72d9a5a3bca58c31bcda68 Mon Sep 17 00:00:00 2001 From: ptv Date: Mon, 14 Nov 2005 12:15:17 +0000 Subject: [PATCH] remove view manager from memory when it become unused --- src/LightApp/LightApp_Application.cxx | 9 +++++++++ src/LightApp/LightApp_Application.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 87e483ecf..19d6fc62e 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1856,3 +1856,12 @@ void LightApp_Application::onWCDestroyed( QObject* ob ) break; } } + +/*! redefined to remove view manager from memory */ +void LightApp_Application::removeViewManager( SUIT_ViewManager* vm ) +{ + disconnect( vm, SIGNAL( lastViewClosed( SUIT_ViewManager* ) ), + this, SLOT( onCloseView( SUIT_ViewManager* ) ) ); + STD_Application::removeViewManager( vm ); + delete vm; +} diff --git a/src/LightApp/LightApp_Application.h b/src/LightApp/LightApp_Application.h index ef00439de..ff42be4ff 100644 --- a/src/LightApp/LightApp_Application.h +++ b/src/LightApp/LightApp_Application.h @@ -79,6 +79,7 @@ public: void updateActions(); SUIT_ViewManager* getViewManager( const QString&, const bool ); + virtual void removeViewManager( SUIT_ViewManager* ); QWidget* getWindow( const int, const int = -1 ); QWidget* window( const int, const int = -1 ) const; void addWindow( QWidget*, const int, const int = -1 ); -- 2.39.2