aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
diff options
context:
space:
mode:
authorPavel Labath <pavel@labath.sk>2022-01-17 11:29:35 +0100
committerPavel Labath <pavel@labath.sk>2022-01-18 10:28:58 +0100
commitc154f397eeb86ea1a5b8fa46405104ace962cec3 (patch)
treedf2a6b975c72e1933494dab0a909e1253035e6e8 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
parentcc0d208805c3d1dac3ec5a44f971b1b5c8ab3a2a (diff)
downloadllvm-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/PythonDataObjects.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index d68af67..13dabb2 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -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)));
}
}