diff --git a/simgear/io/HTTPClient.cxx b/simgear/io/HTTPClient.cxx index 0adf0be8..d5c32af7 100644 --- a/simgear/io/HTTPClient.cxx +++ b/simgear/io/HTTPClient.cxx @@ -48,6 +48,8 @@ #include #include #include +#include +#include #if defined( HAVE_VERSION_H ) && HAVE_VERSION_H #include "version.h" @@ -123,6 +125,9 @@ Client::Client() : setUserAgent("SimGear-" SG_STRINGIZE(SIMGEAR_VERSION)); static bool didInitCurlGlobal = false; + static SGMutex initMutex; + + SGGuard g(initMutex); if (!didInitCurlGlobal) { curl_global_init(CURL_GLOBAL_ALL); didInitCurlGlobal = true;