summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorZachary Turner <zturner@google.com>2017-07-09 23:32:15 +0000
committerZachary Turner <zturner@google.com>2017-07-09 23:32:15 +0000
commitac43c1bb87ac24550c4b1203abf2d783e58619fe (patch)
tree504b0813452b268d6428f32c10a66bff258207cc /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent3733fc401112640a4b82e4556ba8e9fa4f106cbd (diff)
downloadbcm5719-llvm-ac43c1bb87ac24550c4b1203abf2d783e58619fe.tar.gz
bcm5719-llvm-ac43c1bb87ac24550c4b1203abf2d783e58619fe.zip
Don't access Python objects while not holding the GIL.
Patch by Tatyana Krasnukha Differential Revision: https://reviews.llvm.org/D34942 llvm-svn: 307512
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index b7fbd7347d0..6c39690268c 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -1857,14 +1857,12 @@ StructuredData::DictionarySP ScriptInterpreterPython::GetDynamicSettings(
return StructuredData::DictionarySP();
PythonObject reply_pyobj;
- {
- Locker py_lock(this,
- Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
- TargetSP target_sp(target->shared_from_this());
- reply_pyobj.Reset(PyRefType::Owned,
- (PyObject *)g_swig_plugin_get(generic->GetValue(),
- setting_name, target_sp));
- }
+ Locker py_lock(this,
+ Locker::AcquireLock | Locker::InitSession | Locker::NoSTDIN);
+ TargetSP target_sp(target->shared_from_this());
+ reply_pyobj.Reset(PyRefType::Owned,
+ (PyObject *)g_swig_plugin_get(generic->GetValue(),
+ setting_name, target_sp));
PythonDictionary py_dict(PyRefType::Borrowed, reply_pyobj.get());
return py_dict.CreateStructuredDictionary();
OpenPOWER on IntegriCloud