Skip to content

Commit 3198cff

Browse files
committed
fix(headless): Set DX8Wrapper_IsWindowed to false in headless mode to suppress assertion dialogs during shutdown
1 parent 72c9262 commit 3198cff

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

GeneralsMD/Code/Main/WinMain.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,15 @@ Int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
875875
#endif
876876

877877
// register windows class and create application window
878-
if(!TheGlobalData->m_headless && initializeAppWindows(hInstance, nCmdShow, TheGlobalData->m_windowed) == false)
878+
// TheSuperHackers @fix bobtista 02/03/2026 Set DX8Wrapper_IsWindowed to false in headless
879+
// mode so that ignoringAsserts() works correctly throughout the entire process lifetime,
880+
// including during shutdown after TheGlobalData has been destroyed.
881+
if (TheGlobalData->m_headless)
882+
{
883+
extern bool DX8Wrapper_IsWindowed;
884+
DX8Wrapper_IsWindowed = false;
885+
}
886+
else if (initializeAppWindows(hInstance, nCmdShow, TheGlobalData->m_windowed) == false)
879887
return exitcode;
880888

881889
// save our application instance for future use

0 commit comments

Comments
 (0)