summaryrefslogtreecommitdiffstats
path: root/libshiboken
diff options
context:
space:
mode:
authorHugo Parente Lima <hugo.pl@gmail.com>2011-10-17 15:02:08 -0200
committerHugo Parente Lima <hugo.pl@gmail.com>2011-10-18 16:59:51 -0200
commitce79f7578e3d057e5a687b47d0d787c36da46cbd (patch)
tree632fa59aa7d34b43c3d3c1ea983792f63104f49c /libshiboken
parentdb044d298e2eb1853991ca73bb44a20783b0032f (diff)
downloadshiboken-ce79f7578e3d057e5a687b47d0d787c36da46cbd.tar.gz
shiboken-ce79f7578e3d057e5a687b47d0d787c36da46cbd.tar.xz
shiboken-ce79f7578e3d057e5a687b47d0d787c36da46cbd.zip
Add constructor overload AutoDecRef(SbkObject*).
Diffstat (limited to 'libshiboken')
-rw-r--r--libshiboken/autodecref.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libshiboken/autodecref.h b/libshiboken/autodecref.h
index da496f6e..8ab2c25a 100644
--- a/libshiboken/autodecref.h
+++ b/libshiboken/autodecref.h
@@ -26,6 +26,7 @@
#include "sbkpython.h"
#include "shibokenmacros.h"
+class SbkObject;
namespace Shiboken
{
@@ -40,6 +41,11 @@ public:
* \param pyobj A borrowed reference to a Python object
*/
explicit AutoDecRef(PyObject* pyObj) : m_pyObj(pyObj) {}
+ /**
+ * AutoDecRef constructor.
+ * \param pyobj A borrowed reference to a Python object
+ */
+ explicit AutoDecRef(SbkObject* pyObj) : m_pyObj(reinterpret_cast<PyObject*>(pyObj)) {}
/// Decref the borrowed python reference
~AutoDecRef()