From 97c45455fd762196a583b6da361caf313b314124 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 12 Aug 2012 21:21:23 +0200 Subject: [PATCH] fix WindowManager destruction --- apps/openmw/mwbase/environment.cpp | 3 +-- apps/openmw/mwgui/windowmanagerimp.cpp | 3 ++- libs/openengine/gui/manager.cpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwbase/environment.cpp b/apps/openmw/mwbase/environment.cpp index 8d786db91..9aaa5af85 100644 --- a/apps/openmw/mwbase/environment.cpp +++ b/apps/openmw/mwbase/environment.cpp @@ -146,8 +146,7 @@ void MWBase::Environment::cleanup() delete mScriptManager; mScriptManager = 0; -/// \todo Re-enable (currently throwing an exception) -// delete mWindowManager; + delete mWindowManager; mWindowManager = 0; delete mWorld; diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 2a6f7ec9b..183c435fd 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -159,7 +159,6 @@ WindowManager::WindowManager( WindowManager::~WindowManager() { - delete mGuiManager; delete mConsole; delete mMessageBoxManager; delete mHud; @@ -182,6 +181,8 @@ WindowManager::~WindowManager() delete mSpellWindow; cleanupGarbage(); + + delete mGuiManager; } void WindowManager::cleanupGarbage() diff --git a/libs/openengine/gui/manager.cpp b/libs/openengine/gui/manager.cpp index 9c6ca37eb..58929ba8b 100644 --- a/libs/openengine/gui/manager.cpp +++ b/libs/openengine/gui/manager.cpp @@ -36,6 +36,7 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool void MyGUIManager::shutdown() { + mGui->shutdown (); delete mGui; if(mPlatform) {