Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Core/GameEngine/Include/GameClient/Shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(); ///< pop now
void showShell( Bool runInit = TRUE ); ///< init the top of stack
void hideShell(); ///< shutdown the top of stack
WindowLayout *top(); ///< return top layout
Expand Down Expand Up @@ -161,6 +161,7 @@ class Shell : public SubsystemInterface

void construct();
void deconstruct();
void destroyScreenStack(); ///< tear down all screens without initializing uncovered layouts

void linkScreen( WindowLayout *screen ); ///< link screen to list
void unlinkScreen( WindowLayout *screen ); ///< remove screen from list
Expand Down
32 changes: 26 additions & 6 deletions Core/GameEngine/Source/GameClient/GUI/Shell/Shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,7 @@ void Shell::construct()
//-------------------------------------------------------------------------------------------------
void Shell::deconstruct()
{
WindowLayout *newTop = top();
while(newTop)
{
popImmediate();
newTop = top();
}
destroyScreenStack();

if(m_background)
{
Expand Down Expand Up @@ -138,6 +133,31 @@ void Shell::deconstruct()
}
}

//-------------------------------------------------------------------------------------------------
/** TheSuperHackers @bugfix CryoTheRenegade 10/08/2026 Tear down every screen on the stack without initializing uncovered layouts.
* Used when the shell itself is being destroyed. */
//-------------------------------------------------------------------------------------------------
void Shell::destroyScreenStack()
{
while( top() )
{
WindowLayout *screen = top();

// do NOT set pending pop, we are going to force a pop after the shutdown is run
m_pendingPop = FALSE;

Bool immediatePop = TRUE;
screen->runShutdown( &immediatePop );

unlinkScreen( screen );
screen->destroyWindows();
deleteInstance( screen );
}

if (TheIMEManager)
TheIMEManager->detach();
}

//-------------------------------------------------------------------------------------------------
/** Initialize the shell system */
//-------------------------------------------------------------------------------------------------
Expand Down
Loading