summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandInterpreter.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2012-07-10 19:04:14 +0000
committerEnrico Granata <egranata@apple.com>2012-07-10 19:04:14 +0000
commit8b95df290ef888c6d124a0b968c429f85dfffb11 (patch)
treeba0b1fd97abc6e6c0ba8879f6a013d7283ac00fe /lldb/source/Interpreter/CommandInterpreter.cpp
parent97c22142779e47740e90e8ea3e0b74d8db46d6a1 (diff)
downloadbcm5719-llvm-8b95df290ef888c6d124a0b968c429f85dfffb11.tar.gz
bcm5719-llvm-8b95df290ef888c6d124a0b968c429f85dfffb11.zip
Turning the interpreter mutex into a static global to avoid a potential leak. Might need to be turned back into a pointer if it causes issues with the destructor chain.
llvm-svn: 160012
Diffstat (limited to 'lldb/source/Interpreter/CommandInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index fb26fc493b4..8d29133acc8 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2397,8 +2397,8 @@ CommandInterpreter::GetScriptInterpreter ()
// this is a bulletproof recipe for disaster!
// this needs to be a function-level static because multiple Debugger instances living in the same process
// still need to be isolated and not try to initialize Python concurrently
- static Mutex *interpreter_mutex = new Mutex(Mutex::eMutexTypeRecursive);
- Mutex::Locker interpreter_lock(*interpreter_mutex);
+ static Mutex g_interpreter_mutex(Mutex::eMutexTypeRecursive);
+ Mutex::Locker interpreter_lock(g_interpreter_mutex);
if (m_script_interpreter_ap.get() != NULL)
return m_script_interpreter_ap.get();
OpenPOWER on IntegriCloud