From c154f397eeb86ea1a5b8fa46405104ace962cec3 Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Mon, 17 Jan 2022 11:29:35 +0100 Subject: [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 --- .../ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp index 6a881bf..fb55d44 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp @@ -43,7 +43,7 @@ StructuredData::GenericSP ScriptedThreadPythonInterface::CreatePluginObject( Locker py_lock(&m_interpreter, Locker::AcquireLock | Locker::NoSTDIN, Locker::FreeLock); - void *ret_val = LLDBSwigPythonCreateScriptedThread( + PythonObject ret_val = LLDBSwigPythonCreateScriptedThread( class_name.str().c_str(), m_interpreter.GetDictionaryName(), process_sp, args_impl, error_string); @@ -51,7 +51,7 @@ StructuredData::GenericSP ScriptedThreadPythonInterface::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; } -- cgit v1.1