[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:
Pavel Labath committed 2022-01-18 10:28:58 +01:00
1 parent cc0d208805
commit c154f397ee
8 files changed
+154 -181

No files matched your search

@@ -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)));
}
}