From 60c24f70fe1f7f37ae34e0ff47cd60db39094a88 Mon Sep 17 00:00:00 2001 From: Zachary Turner Date: Wed, 14 Oct 2015 16:59:32 +0000 Subject: Change swig interface files to use PythonDataObjects. llvm-svn: 250303 --- .../Plugins/ScriptInterpreter/Python/PythonDataObjects.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index 8872b11488d..17ece25c9d3 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -122,7 +122,7 @@ public: { // Avoid calling the virtual method if it's not necessary // to actually validate the type of the PyObject. - if (!rhs.get()) + if (!rhs.IsValid()) Reset(); else Reset(PyRefType::Borrowed, rhs.m_py_obj); @@ -167,12 +167,21 @@ public: Dump (Stream &strm) const; PyObject* - get () const + get() const { return m_py_obj; } - PyObjectType GetObjectType() const; + PyObject* + release() + { + PyObject *result = m_py_obj; + m_py_obj = nullptr; + return result; + } + + PyObjectType + GetObjectType() const; PythonString Repr (); -- cgit v1.2.3