mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-30 02:36:44 +00:00
Made sure dialog garbage is also cleaned up on destruction.
This commit is contained in:
parent
1f7659cb12
commit
f756e171cc
2 changed files with 9 additions and 2 deletions
|
@ -93,11 +93,13 @@ WindowManager::~WindowManager()
|
|||
delete createClassDialog;
|
||||
delete birthSignDialog;
|
||||
delete reviewDialog;
|
||||
|
||||
cleanupGarbage();
|
||||
}
|
||||
|
||||
void WindowManager::update()
|
||||
void WindowManager::cleanupGarbage()
|
||||
{
|
||||
// Delete any dialogs which no longer in use
|
||||
// Delete any dialogs which are no longer in use
|
||||
if (!garbageDialogs.empty())
|
||||
{
|
||||
for (std::vector<OEngine::GUI::Layout*>::iterator it = garbageDialogs.begin(); it != garbageDialogs.end(); ++it)
|
||||
|
@ -106,7 +108,11 @@ void WindowManager::update()
|
|||
}
|
||||
garbageDialogs.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void WindowManager::update()
|
||||
{
|
||||
cleanupGarbage();
|
||||
if (needModeChange)
|
||||
{
|
||||
needModeChange = false;
|
||||
|
|
|
@ -128,6 +128,7 @@ namespace MWGui
|
|||
bool needModeChange;
|
||||
|
||||
std::vector<OEngine::GUI::Layout*> garbageDialogs;
|
||||
void cleanupGarbage();
|
||||
|
||||
// Currently shown windows in inventory mode
|
||||
GuiWindow shown;
|
||||
|
|
Loading…
Reference in a new issue