From 024478e2ee8672cc9e3a64c1b1ccb3c054fd438e Mon Sep 17 00:00:00 2001 From: Jacob Ledbetter Date: Sat, 15 Aug 2026 18:15:46 -0600 Subject: [PATCH 1/2] fix(shell): Avoid initializing layouts during teardown --- Core/GameEngine/Include/GameClient/Shell.h | 2 +- Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Core/GameEngine/Include/GameClient/Shell.h b/Core/GameEngine/Include/GameClient/Shell.h index a593f3cbcba..eb10ac608ec 100644 --- a/Core/GameEngine/Include/GameClient/Shell.h +++ b/Core/GameEngine/Include/GameClient/Shell.h @@ -131,7 +131,7 @@ class Shell : public SubsystemInterface // pseudo-stack operations for manipulating layouts void push( AsciiString filename, Bool shutdownImmediate = FALSE ); ///< load new screen on top, optionally doing an immediate shutdown void pop(); ///< pop top layout - void popImmediate(); ///< pop now, don't wait for shutdown + void popImmediate( Bool suppressInit = FALSE ); ///< pop now, optionally suppressing init of the uncovered layout void showShell( Bool runInit = TRUE ); ///< init the top of stack void hideShell(); ///< shutdown the top of stack WindowLayout *top(); ///< return top layout diff --git a/Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index 1b6278d02db..faa8f30594b 100644 --- a/Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -93,7 +93,8 @@ void Shell::deconstruct() WindowLayout *newTop = top(); while(newTop) { - popImmediate(); + // TheSuperHackers @bugfix CryoTheRenegade 10/08/2026 Do not initialize uncovered screens while the shell is being destroyed. + popImmediate( TRUE ); newTop = top(); } @@ -424,7 +425,7 @@ void Shell::pop() * from the shutdown() for the screen, it will be immediately popped off * the stack */ //------------------------------------------------------------------------------------------------- -void Shell::popImmediate() +void Shell::popImmediate( Bool suppressInit ) { WindowLayout *screen = top(); @@ -448,7 +449,7 @@ void Shell::popImmediate() screen->runShutdown( &immediatePop ); // pop the screen of the stack - doPop( FALSE ); + doPop( suppressInit ); if (TheIMEManager) TheIMEManager->detach(); From 623d82a3d112de92a434618baeee89d49d6ed0d9 Mon Sep 17 00:00:00 2001 From: Jacob Ledbetter Date: Sun, 16 Aug 2026 11:16:52 -0600 Subject: [PATCH 2/2] refactor(shell): Clarify doPop parameter semantics --- Core/GameEngine/Include/GameClient/Shell.h | 2 +- Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/GameEngine/Include/GameClient/Shell.h b/Core/GameEngine/Include/GameClient/Shell.h index eb10ac608ec..ea9409a0565 100644 --- a/Core/GameEngine/Include/GameClient/Shell.h +++ b/Core/GameEngine/Include/GameClient/Shell.h @@ -166,7 +166,7 @@ class Shell : public SubsystemInterface void unlinkScreen( WindowLayout *screen ); ///< remove screen from list void doPush( AsciiString layoutFile ); ///< workhorse for push action - void doPop( Bool impendingPush ); ///< workhorse for pop action + void doPop( Bool suppressInit ); ///< workhorse for pop action enum { MAX_SHELL_STACK = 16 }; ///< max simultaneous shell screens WindowLayout *m_screenStack[ MAX_SHELL_STACK ]; ///< the screen layout stack diff --git a/Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp b/Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp index faa8f30594b..b9f1d1898b4 100644 --- a/Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp +++ b/Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp @@ -686,7 +686,7 @@ void Shell::doPush( AsciiString layoutFile ) //------------------------------------------------------------------------------------------------- /** Actually do the work for a pop */ //------------------------------------------------------------------------------------------------- -void Shell::doPop( Bool impendingPush ) +void Shell::doPop( Bool suppressInit ) { WindowLayout *currentTop = top(); @@ -707,7 +707,7 @@ void Shell::doPop( Bool impendingPush ) // run the init for the new top of the stack if present WindowLayout *newTop = top(); - if( newTop && !impendingPush ) + if( newTop && !suppressInit ) { newTop->runInit( nullptr ); //newTop->bringForward();