Skip to content

Commit 3466fed

Browse files
authored
Merge pull request #484 from GeneralsOnlineDevelopmentTeam/seer/fix/libcurl-eac-init-order
bugfix(libcurl): Initialize libcurl before plugins to prevent access violation
2 parents bc32eb8 + 8f2c828 commit 3466fed

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/HTTP/HTTPManager.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,6 @@ void HTTPManager::Initialize()
195195
{
196196
CHECK_MAIN_THREAD;
197197

198-
// Initialize libcurl global state
199-
curl_global_init(CURL_GLOBAL_DEFAULT);
200-
201198
m_pCurl = curl_multi_init();
202199
m_bProxyEnabled = DeterminePlatformProxySettings();
203200
}

GeneralsMD/Code/GameEngine/Source/GameNetwork/GeneralsOnline/OnlineServices_Init.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,11 @@ void NGMP_OnlineServicesManager::Tick()
987987

988988
void NGMP_OnlineServicesManager::InitSentry()
989989
{
990+
// Initialize libcurl global state here, before any plugins (e.g. EasyAntiCheat) are loaded.
991+
// This ensures libcurl's internal mutexes are fully initialized before the EAC plugin
992+
// attempts to use them, preventing an access violation in mtx_do_lock on null mutex state.
993+
curl_global_init(CURL_GLOBAL_DEFAULT);
994+
990995
#if !_DEBUG
991996
std::string strDumpPath = std::format("{}/GeneralsOnlineCrashData/", TheGlobalData->getPath_UserData().str());
992997
if (!std::filesystem::exists(strDumpPath))

0 commit comments

Comments
 (0)