1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-28 19:21:04 +00:00

Hide message box before deleting it

Fixes a crash when closing the game window during the 'plugin mismatch' dialog. Modal windows have to be hidden before they are deleted to prevent a dangling pointer in WindowManager.
This commit is contained in:
scrawl 2017-09-27 22:18:47 +02:00
parent d53e7f8a3c
commit 0ae009eb21

View File

@ -36,8 +36,13 @@ namespace MWGui
void MessageBoxManager::clear() void MessageBoxManager::clear()
{ {
delete mInterMessageBoxe; if (mInterMessageBoxe)
mInterMessageBoxe = NULL; {
mInterMessageBoxe->setVisible(false);
delete mInterMessageBoxe;
mInterMessageBoxe = NULL;
}
std::vector<MessageBox*>::iterator it(mMessageBoxes.begin()); std::vector<MessageBox*>::iterator it(mMessageBoxes.begin());
for (; it != mMessageBoxes.end(); ++it) for (; it != mMessageBoxes.end(); ++it)