[Lldb-commits] [lldb] r160012 - /lldb/trunk/source/Interpreter/CommandInterpreter.cpp
Enrico Granata
egranata at apple.com
Tue Jul 10 12:04:14 PDT 2012
Author: enrico
Date: Tue Jul 10 14:04:14 2012
New Revision: 160012
URL: http://llvm.org/viewvc/llvm-project?rev=160012&view=rev
Log:
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.
Modified:
lldb/trunk/source/Interpreter/CommandInterpreter.cpp
Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=160012&r1=160011&r2=160012&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Tue Jul 10 14:04:14 2012
@@ -2397,8 +2397,8 @@
// 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();
More information about the lldb-commits
mailing list