@@ -121,7 +121,6 @@ CCore::CCore()
121121
122122 m_bIsOfflineMod = false ;
123123 m_bQuitOnPulse = false ;
124- m_bIsQuitting = false ;
125124 m_bDestroyMessageBox = false ;
126125 m_bCursorToggleControls = false ;
127126 m_bLastFocused = true ;
@@ -1166,12 +1165,7 @@ CWebCoreInterface* CCore::GetWebCore()
11661165void CCore::DestroyWeb ()
11671166{
11681167 WriteDebugEvent (" CCore::DestroyWeb" );
1169- // Skip CEF cleanup during quit sequence - TerminateProcess will handle it
1170- // Doing CefShutdown() here will cause a freeze, and cleanup is unnecessary when terminating
1171- if (!m_bIsQuitting)
1172- {
1173- SAFE_DELETE (m_pWebCore);
1174- }
1168+ SAFE_DELETE (m_pWebCore);
11751169 m_WebCoreModule.UnloadModule ();
11761170}
11771171
@@ -1464,7 +1458,6 @@ void CCore::Quit(bool bInstantly)
14641458{
14651459 if (bInstantly)
14661460 {
1467- m_bIsQuitting = true ; // Skip CEF cleanup to prevent CefShutdown freeze
14681461 AddReportLog (7101 , " Core - Quit" );
14691462 // Show that we are quiting (for the crash dump filename)
14701463 SetApplicationSettingInt (" last-server-ip" , 1 );
@@ -1478,13 +1471,13 @@ void CCore::Quit(bool bInstantly)
14781471 // Destroy the client
14791472 CModManager::GetSingleton ().Unload ();
14801473
1481- // Destroy ourself
1474+ // Use TerminateProcess before destroying CCore to ensure clean exit code
1475+ TerminateProcess (GetCurrentProcess (), 0 );
1476+
1477+ // Destroy ourself (unreachable but kept for completeness)
14821478 delete CCore::GetSingletonPtr ();
14831479
14841480 WatchDogCompletedSection (" Q0" );
1485-
1486- // Use TerminateProcess for now as exiting the normal way crashes
1487- TerminateProcess (GetCurrentProcess (), 0 );
14881481 }
14891482 else
14901483 {
0 commit comments