From 4caf7ca30a32766f59982de481c999361f5874f6 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 6 Jan 2018 20:16:32 +0200 Subject: [PATCH] [Client] Add temporary fix for crashes caused by custom GUI elements --- apps/openmw/mwgui/windowmanagerimp.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwgui/windowmanagerimp.cpp b/apps/openmw/mwgui/windowmanagerimp.cpp index a5c3a3b2a..55331d933 100644 --- a/apps/openmw/mwgui/windowmanagerimp.cpp +++ b/apps/openmw/mwgui/windowmanagerimp.cpp @@ -908,8 +908,23 @@ 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()) - mCurrentModals.back()->onFrame(frameDuration); + { + if (mCurrentModals.back()->mMainWidget != 0) + mCurrentModals.back()->onFrame(frameDuration); + else + mCurrentModals.pop_back(); + } + /* + End of tes3mp change (major) + */ mKeyboardNavigation->onFrame();