[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
This commit is contained in:
1 parent
cc0d208805
commit
c154f397ee
8 files changed
+154
-181
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user