[Client] Fix ListBox overlap crashes by removing ListBoxes properly

0.6.2
David Cernat 7 years ago
parent c6a85ee8f9
commit e3bc11d9eb

@ -908,23 +908,8 @@ namespace MWGui
window->onFrame(frameDuration);
}
/*
Start of tes3mp change (major)
Custom GUI elements added by TES3MP often cause a crash here when their
mMainWidget becomes null, so a temporary fix has been added until a
more appropriate solution is researched
*/
if (!mCurrentModals.empty())
{
if (mCurrentModals.back()->mMainWidget != 0)
mCurrentModals.back()->onFrame(frameDuration);
else
mCurrentModals.pop_back();
}
/*
End of tes3mp change (major)
*/
mCurrentModals.back()->onFrame(frameDuration);
mKeyboardNavigation->onFrame();

@ -100,8 +100,13 @@ void mwmp::GUIController::setChatVisible(bool chatVisible)
void mwmp::GUIController::showDialogList(const mwmp::BasePlayer::GUIMessageBox &guiMessageBox)
{
MWBase::WindowManager *windowManager = MWBase::Environment::get().getWindowManager();
windowManager->removeDialog(mListBox);
mListBox = nullptr;
if (mListBox != NULL)
{
windowManager->removeDialog(mListBox);
windowManager->removeCurrentModal(mListBox);
mListBox = NULL;
}
std::vector<std::string> list;

Loading…
Cancel
Save