[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:
@@ -280,7 +280,8 @@ StructuredData::ObjectSP PythonObject::CreateStructuredObject() const {
|
||||
case PyObjectType::None:
|
||||
return StructuredData::ObjectSP();
|
||||
default:
|
||||
return StructuredData::ObjectSP(new StructuredPythonObject(m_py_obj));
|
||||
return StructuredData::ObjectSP(new StructuredPythonObject(
|
||||
PythonObject(PyRefType::Borrowed, m_py_obj)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user