Index: include/lldb/Host/HostInfoBase.h =================================================================== --- include/lldb/Host/HostInfoBase.h +++ include/lldb/Host/HostInfoBase.h @@ -34,6 +34,8 @@ public: static void Initialize(); + static void + Terminate(); //------------------------------------------------------------------ /// Returns the number of CPUs on this current host. Index: source/Host/common/HostInfoBase.cpp =================================================================== --- source/Host/common/HostInfoBase.cpp +++ source/Host/common/HostInfoBase.cpp @@ -82,6 +82,14 @@ g_fields = new HostInfoBaseFields(); } +void +HostInfoBase::Terminate() +{ + CleanupProcessSpecificLLDBTempDir(); + delete g_fields; + g_fields = nullptr; +} + uint32_t HostInfoBase::GetNumberCPUS() { @@ -335,9 +343,6 @@ if (!FileSystem::MakeDirectory(temp_file_spec, eFilePermissionsDirectoryDefault).Success()) return false; - // Make an atexit handler to clean up the process specify LLDB temp dir - // and all of its contents. - ::atexit(CleanupProcessSpecificLLDBTempDir); file_spec.GetDirectory().SetCString(temp_file_spec.GetCString()); return true; } Index: source/Initialization/SystemInitializerCommon.cpp =================================================================== --- source/Initialization/SystemInitializerCommon.cpp +++ source/Initialization/SystemInitializerCommon.cpp @@ -197,6 +197,7 @@ #endif OperatingSystemGo::Terminate(); + HostInfoBase::Terminate(); Log::Terminate(); #if defined(_MSC_VER)