Merge pull request #418 from diamante0018/fix/clearing-static-variable
Do not clear a static variable
This commit is contained in:
commit
49ed76807b
@ -11,7 +11,7 @@ namespace Main
|
||||
#if defined(DEBUG) || defined(FORCE_UNIT_TESTS)
|
||||
if (Components::Loader::IsPerformingUnitTests())
|
||||
{
|
||||
DWORD result = (Components::Loader::PerformUnitTests() ? 0 : -1);
|
||||
auto result = (Components::Loader::PerformUnitTests() ? 0 : -1);
|
||||
Components::Loader::Uninitialize();
|
||||
ExitProcess(result);
|
||||
}
|
||||
@ -26,7 +26,6 @@ namespace Main
|
||||
void Uninitialize()
|
||||
{
|
||||
Components::Loader::Uninitialize();
|
||||
Utils::Cache::Uninitialize();
|
||||
google::protobuf::ShutdownProtobufLibrary();
|
||||
}
|
||||
|
||||
@ -45,13 +44,10 @@ namespace Main
|
||||
}
|
||||
}
|
||||
|
||||
BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
|
||||
BOOL APIENTRY DllMain(HINSTANCE /*hinstDLL*/, DWORD fdwReason, LPVOID /*lpvReserved*/)
|
||||
{
|
||||
if (ul_reason_for_call == DLL_PROCESS_ATTACH)
|
||||
if (fdwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
// Not sure if it conflicts with our TLS variables
|
||||
//DisableThreadLibraryCalls(hModule);
|
||||
|
||||
Steam::Proxy::RunMod();
|
||||
|
||||
#ifndef DISABLE_BINARY_CHECK
|
||||
@ -75,7 +71,7 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l
|
||||
// Install entry point hook
|
||||
Utils::Hook(0x6BAC0F, Main::EntryPoint, HOOK_JUMP).install()->quick();
|
||||
}
|
||||
else if (ul_reason_for_call == DLL_PROCESS_DETACH)
|
||||
else if (fdwReason == DLL_PROCESS_DETACH)
|
||||
{
|
||||
Main::Uninitialize();
|
||||
}
|
||||
|
@ -48,10 +48,4 @@ namespace Utils
|
||||
return Utils::WebIO(useragent, Cache::GetUrl(Cache::ValidUrl, path)).setTimeout(timeout)->get();
|
||||
}
|
||||
}
|
||||
|
||||
void Cache::Uninitialize()
|
||||
{
|
||||
std::lock_guard<std::mutex> _(Cache::CacheMutex);
|
||||
Cache::ValidUrl.clear();
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ namespace Utils
|
||||
public:
|
||||
static std::string GetStaticUrl(const std::string& path);
|
||||
static std::string GetFile(const std::string& path, int timeout = 5000, const std::string& useragent = "IW4x");
|
||||
static void Uninitialize();
|
||||
|
||||
private:
|
||||
static std::mutex CacheMutex;
|
||||
|
Loading…
Reference in New Issue
Block a user