diff --git a/profiler/src/profiler/TracyLlm.cpp b/profiler/src/profiler/TracyLlm.cpp index d2afa33d..4f89af44 100644 --- a/profiler/src/profiler/TracyLlm.cpp +++ b/profiler/src/profiler/TracyLlm.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -26,6 +27,14 @@ TracyLlm::TracyLlm() { if( !s_config.llm ) return; + static bool initialized = false; + if( !initialized ) + { + initialized = true; + curl_global_init( CURL_GLOBAL_ALL ); + atexit( curl_global_cleanup ); + } + try { m_ollama = std::make_unique( s_config.llmAddress ); diff --git a/profiler/src/profiler/TracyLlmTools.cpp b/profiler/src/profiler/TracyLlmTools.cpp index 6244c3c4..7c2da8f0 100644 --- a/profiler/src/profiler/TracyLlmTools.cpp +++ b/profiler/src/profiler/TracyLlmTools.cpp @@ -113,14 +113,6 @@ std::string TracyLlmTools::FetchWebPage( const std::string& url ) auto it = m_webCache.find( url ); if( it != m_webCache.end() ) return it->second; - static bool initialized = false; - if( !initialized ) - { - initialized = true; - curl_global_init( CURL_GLOBAL_ALL ); - atexit( curl_global_cleanup ); - } - auto curl = curl_easy_init(); if( !curl ) return "Error: Failed to initialize cURL";