Skip to content

Commit

Permalink
Add constructor overload AutoDecRef(SbkObject*).
Browse files Browse the repository at this point in the history
  • Loading branch information
hugopl committed Oct 18, 2011
1 parent db044d2 commit ce79f75
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libshiboken/autodecref.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "sbkpython.h"
#include "shibokenmacros.h"

class SbkObject;
namespace Shiboken
{

Expand All @@ -40,6 +41,11 @@ class LIBSHIBOKEN_API AutoDecRef
* \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()
Expand Down

0 comments on commit ce79f75

Please sign in to comment.