diff options
-rw-r--r-- | lldb/source/Target/Process.cpp | 7 | ||||
-rw-r--r-- | lldb/source/Target/Target.cpp | 7 | ||||
-rw-r--r-- | lldb/source/Target/Thread.cpp | 7 |
3 files changed, 6 insertions, 15 deletions
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index 4448ed0720d..b539ea3a2ee 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -812,11 +812,8 @@ Process::~Process() { const ProcessPropertiesSP &Process::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static ProcessPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new ProcessPropertiesSP(new ProcessProperties(nullptr)); - }); + static ProcessPropertiesSP *g_settings_sp_ptr = + new ProcessPropertiesSP(new ProcessProperties(nullptr)); return *g_settings_sp_ptr; } diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp index f4a91192cfd..3fb53009415 100644 --- a/lldb/source/Target/Target.cpp +++ b/lldb/source/Target/Target.cpp @@ -2643,11 +2643,8 @@ void Target::RunStopHooks() { const TargetPropertiesSP &Target::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static TargetPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new TargetPropertiesSP(new TargetProperties(nullptr)); - }); + static TargetPropertiesSP *g_settings_sp_ptr = + new TargetPropertiesSP(new TargetProperties(nullptr)); return *g_settings_sp_ptr; } diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 676bbf09b5e..10678ecf415 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -58,11 +58,8 @@ using namespace lldb_private; const ThreadPropertiesSP &Thread::GetGlobalProperties() { // NOTE: intentional leak so we don't crash if global destructor chain gets // called as other threads still use the result of this function - static ThreadPropertiesSP *g_settings_sp_ptr = nullptr; - static std::once_flag g_once_flag; - std::call_once(g_once_flag, []() { - g_settings_sp_ptr = new ThreadPropertiesSP(new ThreadProperties(true)); - }); + static ThreadPropertiesSP *g_settings_sp_ptr = + new ThreadPropertiesSP(new ThreadProperties(true)); return *g_settings_sp_ptr; } |