aboutsummaryrefslogtreecommitdiffstats
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>2012-03-08 16:18:23 -0300
commitba1e6dfea28a472e4137984581ac96c7486c89b7 (patch)
tree3f61427181c9ca4a566bd256624abca4f9293083
parent42e73675311c4ef43361865fac2b467680ac366d (diff)
Add constructor overload AutoDecRef(SbkObject*).
-rw-r--r--libshiboken/autodecref.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libshiboken/autodecref.h b/libshiboken/autodecref.h
index da496f6e1..8ab2c25a3 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()