diff options
author | Pavel Labath <pavel@labath.sk> | 2022-01-17 11:29:35 +0100 |
---|---|---|
committer | Pavel Labath <pavel@labath.sk> | 2022-01-18 10:28:58 +0100 |
commit | c154f397eeb86ea1a5b8fa46405104ace962cec3 (patch) | |
tree | df2a6b975c72e1933494dab0a909e1253035e6e8 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp | |
parent | cc0d208805c3d1dac3ec5a44f971b1b5c8ab3a2a (diff) | |
download | llvm-c154f397eeb86ea1a5b8fa46405104ace962cec3.zip llvm-c154f397eeb86ea1a5b8fa46405104ace962cec3.tar.gz llvm-c154f397eeb86ea1a5b8fa46405104ace962cec3.tar.bz2 |
[lldb/python] Use PythonObject in LLDBSwigPython functions
Return our PythonObject wrappers instead of raw PyObjects (obfuscated as
void *). This ensures that ownership (reference counts) of python
objects is automatically tracked.
Differential Revision: https://reviews.llvm.org/D117462
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp index e3c1931..da8ff42 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp @@ -43,7 +43,7 @@ StructuredData::GenericSP ScriptedProcessPythonInterface::CreatePluginObject( Locker py_lock(&m_interpreter, Locker::AcquireLock | Locker::NoSTDIN, Locker::FreeLock); - void *ret_val = LLDBSwigPythonCreateScriptedProcess( + PythonObject ret_val = LLDBSwigPythonCreateScriptedProcess( class_name.str().c_str(), m_interpreter.GetDictionaryName(), target_sp, args_impl, error_string); @@ -51,7 +51,7 @@ StructuredData::GenericSP ScriptedProcessPythonInterface::CreatePluginObject( return {}; m_object_instance_sp = - StructuredData::GenericSP(new StructuredPythonObject(ret_val)); + StructuredData::GenericSP(new StructuredPythonObject(std::move(ret_val))); return m_object_instance_sp; } |