Skip to content

Commit 1281716

Browse files
committed
Fix 3 issues: MTA freeze on quit, CEF crash on quit (non-user facing), and 'Quit' closing the game being slow to clear the last frame due to redundant blocking operation.
1 parent baad050 commit 1281716

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Client/core/CCore.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ CCore::CCore()
121121

122122
m_bIsOfflineMod = false;
123123
m_bQuitOnPulse = false;
124+
m_bIsQuitting = false;
124125
m_bDestroyMessageBox = false;
125126
m_bCursorToggleControls = false;
126127
m_bLastFocused = true;
@@ -1203,7 +1204,12 @@ CWebCoreInterface* CCore::GetWebCore()
12031204
void CCore::DestroyWeb()
12041205
{
12051206
WriteDebugEvent("CCore::DestroyWeb");
1206-
SAFE_DELETE(m_pWebCore);
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+
}
12071213
m_WebCoreModule.UnloadModule();
12081214
}
12091215

@@ -1496,6 +1502,7 @@ void CCore::Quit(bool bInstantly)
14961502
{
14971503
if (bInstantly)
14981504
{
1505+
m_bIsQuitting = true; // Skip CEF cleanup to prevent CefShutdown freeze
14991506
AddReportLog(7101, "Core - Quit");
15001507
// Show that we are quiting (for the crash dump filename)
15011508
SetApplicationSettingInt("last-server-ip", 1);

Client/core/CCore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ class CCore : public CCoreInterface, public CSingleton<CCore>
366366
SString m_strModInstallRoot;
367367

368368
bool m_bQuitOnPulse;
369+
bool m_bIsQuitting;
369370
bool m_bDestroyMessageBox;
370371

371372
bool m_requestNewNickname{false};

0 commit comments

Comments
 (0)