mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 21:06:43 +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 createClassDialog;
|
||||||
delete birthSignDialog;
|
delete birthSignDialog;
|
||||||
delete reviewDialog;
|
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())
|
if (!garbageDialogs.empty())
|
||||||
{
|
{
|
||||||
for (std::vector<OEngine::GUI::Layout*>::iterator it = garbageDialogs.begin(); it != garbageDialogs.end(); ++it)
|
for (std::vector<OEngine::GUI::Layout*>::iterator it = garbageDialogs.begin(); it != garbageDialogs.end(); ++it)
|
||||||
|
@ -106,7 +108,11 @@ void WindowManager::update()
|
||||||
}
|
}
|
||||||
garbageDialogs.clear();
|
garbageDialogs.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void WindowManager::update()
|
||||||
|
{
|
||||||
|
cleanupGarbage();
|
||||||
if (needModeChange)
|
if (needModeChange)
|
||||||
{
|
{
|
||||||
needModeChange = false;
|
needModeChange = false;
|
||||||
|
|
|
@ -128,6 +128,7 @@ namespace MWGui
|
||||||
bool needModeChange;
|
bool needModeChange;
|
||||||
|
|
||||||
std::vector<OEngine::GUI::Layout*> garbageDialogs;
|
std::vector<OEngine::GUI::Layout*> garbageDialogs;
|
||||||
|
void cleanupGarbage();
|
||||||
|
|
||||||
// Currently shown windows in inventory mode
|
// Currently shown windows in inventory mode
|
||||||
GuiWindow shown;
|
GuiWindow shown;
|
||||||
|
|
Loading…
Reference in a new issue