@@ -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 ;
@@ -1204,12 +1203,7 @@ CWebCoreInterface* CCore::GetWebCore()
12041203void CCore::DestroyWeb ()
12051204{
12061205 WriteDebugEvent (" CCore::DestroyWeb" );
1207- // Skip CEF cleanup during quit sequence - TerminateProcess will handle it
1208- // Doing CefShutdown() here will cause a freeze, and cleanup is unnecessary when terminating
1209- if (!m_bIsQuitting)
1210- {
1211- SAFE_DELETE (m_pWebCore);
1212- }
1206+ SAFE_DELETE (m_pWebCore);
12131207 m_WebCoreModule.UnloadModule ();
12141208}
12151209
@@ -1502,7 +1496,6 @@ void CCore::Quit(bool bInstantly)
15021496{
15031497 if (bInstantly)
15041498 {
1505- m_bIsQuitting = true ; // Skip CEF cleanup to prevent CefShutdown freeze
15061499 AddReportLog (7101 , " Core - Quit" );
15071500 // Show that we are quiting (for the crash dump filename)
15081501 SetApplicationSettingInt (" last-server-ip" , 1 );
@@ -1516,13 +1509,13 @@ void CCore::Quit(bool bInstantly)
15161509 // Destroy the client
15171510 CModManager::GetSingleton ().Unload ();
15181511
1519- // Destroy ourself
1512+ // Use TerminateProcess before destroying CCore to ensure clean exit code
1513+ TerminateProcess (GetCurrentProcess (), 0 );
1514+
1515+ // Destroy ourself (unreachable but kept for completeness)
15201516 delete CCore::GetSingletonPtr ();
15211517
15221518 WatchDogCompletedSection (" Q0" );
1523-
1524- // Use TerminateProcess for now as exiting the normal way crashes
1525- TerminateProcess (GetCurrentProcess (), 0 );
15261519 }
15271520 else
15281521 {
0 commit comments