Merge branch 'settingscrash' into 'master'

Fix some dangling window pointer use on exit

See merge request OpenMW/openmw!4846
This commit is contained in:
Alexei Kotov 2025-08-14 13:52:56 +03:00
commit 32e463945e

View File

@ -891,6 +891,9 @@ namespace MWGui
if (!mCurrentModals.empty()) if (!mCurrentModals.empty())
return mCurrentModals.back(); return mCurrentModals.back();
if (mWindows.empty())
return nullptr;
if (isSettingsWindowVisible()) if (isSettingsWindowVisible())
return mSettingsWindow; return mSettingsWindow;
@ -2650,6 +2653,9 @@ namespace MWGui
if (!Settings::gui().mControllerMenus || !mControllerButtonsOverlay) if (!Settings::gui().mControllerMenus || !mControllerButtonsOverlay)
return; return;
if (mWindows.empty())
return;
WindowBase* topWin = getActiveControllerWindow(); WindowBase* topWin = getActiveControllerWindow();
if (!topWin || !topWin->isVisible()) if (!topWin || !topWin->isVisible())
{ {