diff options
Diffstat (limited to 'sources/shiboken2/libshiboken/autodecref.h')
-rw-r--r-- | sources/shiboken2/libshiboken/autodecref.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sources/shiboken2/libshiboken/autodecref.h b/sources/shiboken2/libshiboken/autodecref.h index 498b1aec4..6e6d5db95 100644 --- a/sources/shiboken2/libshiboken/autodecref.h +++ b/sources/shiboken2/libshiboken/autodecref.h @@ -101,6 +101,14 @@ public: m_pyObj = other; Py_XDECREF(_py_tmp); } + + PyObject *release() + { + PyObject *result = m_pyObj; + m_pyObj = nullptr; + return result; + } + private: PyObject *m_pyObj; }; |