From 2ea9d6ba20976124b8d2a42a7e129ed0e3678923 Mon Sep 17 00:00:00 2001 From: Dave Corley Date: Wed, 11 Sep 2024 13:16:13 -0700 Subject: [PATCH] FIX(windowmanagerimp): Don't remove a ui mode twice --- apps/openmw/mwgui/windowmanagerimp.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index 64bb0c66ca..b2b576522f 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -1323,9 +1323,12 @@ namespace MWGui window->exit(); } mKeyboardNavigation->saveFocus(mode); - mGuiModes.pop_back(); - mGuiModeStates[mode].update(false); - MWBase::Environment::get().getLuaManager()->uiModeChanged(MWWorld::Ptr()); + if (containsMode(mode)) + { + mGuiModes.pop_back(); + mGuiModeStates[mode].update(false); + MWBase::Environment::get().getLuaManager()->uiModeChanged(MWWorld::Ptr()); + } } if (!mGuiModes.empty())