From bbfd0e15cbda7b408e54df7a0d52f7804fa4b2d3 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Sun, 8 Jun 2014 19:39:58 +0200 Subject: [PATCH] Remove Object Viewer menus when unloading the plugin. --- code/studio/src/plugins/object_viewer/main_window.cpp | 11 +++++++++++ code/studio/src/plugins/object_viewer/main_window.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/code/studio/src/plugins/object_viewer/main_window.cpp b/code/studio/src/plugins/object_viewer/main_window.cpp index 91f832ac0..864896ca1 100644 --- a/code/studio/src/plugins/object_viewer/main_window.cpp +++ b/code/studio/src/plugins/object_viewer/main_window.cpp @@ -71,6 +71,7 @@ CMainWindow::CMainWindow(QWidget *parent) _lastDir("."), _mouseMode(NL3D::U3dMouseListener::edit3d) { + menu = NULL; nldebug("CMainWindow::CMainWindow:"); setObjectName("CMainWindow"); @@ -134,6 +135,8 @@ CMainWindow::~CMainWindow() settings->endGroup(); settings->sync(); + removeMenus(); + delete _AnimationDialog; delete _AnimationSetDialog; delete _SlotManagerDialog; @@ -323,6 +326,14 @@ void CMainWindow::createMenus() connect(_ParticleControlDialog->toggleViewAction(), SIGNAL(triggered(bool)), _ParticleWorkspaceDialog->_PropertyDialog, SLOT(setVisible(bool))); + menu = ovMenu; + +} + +void CMainWindow::removeMenus() +{ + delete menu; + menu = NULL; } void CMainWindow::createToolBars() diff --git a/code/studio/src/plugins/object_viewer/main_window.h b/code/studio/src/plugins/object_viewer/main_window.h index 5a392c191..dff4d9b4b 100644 --- a/code/studio/src/plugins/object_viewer/main_window.h +++ b/code/studio/src/plugins/object_viewer/main_window.h @@ -95,6 +95,7 @@ protected: private: void createActions(); void createMenus(); + void removeMenus(); void createToolBars(); void createDialogs(); @@ -144,6 +145,8 @@ private: uint _numTri; float _texMem; sint _mouseMode; + + QMenu *menu; };/* class CMainWindow */ } /* namespace NLQT */