mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 18:12:43 +00:00
Added reset()
[SVN r16465]
This commit is contained in:
@@ -109,6 +109,7 @@ class handle
|
||||
T& operator* () const;
|
||||
T* get() const;
|
||||
T* release();
|
||||
void reset();
|
||||
|
||||
operator bool_type() const // never throws
|
||||
{
|
||||
@@ -227,6 +228,13 @@ inline T* handle<T>::release()
|
||||
return result;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline void handle<T>::reset()
|
||||
{
|
||||
python::xdecref(m_p);
|
||||
m_p = 0;
|
||||
}
|
||||
|
||||
// Because get_managed_object must return a non-null PyObject*, we
|
||||
// return Py_None if the handle is null.
|
||||
template <class T>
|
||||
|
||||
Reference in New Issue
Block a user