We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8467f36 commit ae9f394Copy full SHA for ae9f394
1 file changed
include/boost/python/handle.hpp
@@ -109,6 +109,7 @@ class handle
109
T& operator* () const;
110
T* get() const;
111
T* release();
112
+ void reset();
113
114
operator bool_type() const // never throws
115
{
@@ -227,6 +228,13 @@ inline T* handle<T>::release()
227
228
return result;
229
}
230
231
+template <class T>
232
+inline void handle<T>::reset()
233
+{
234
+ python::xdecref(m_p);
235
+ m_p = 0;
236
+}
237
+
238
// Because get_managed_object must return a non-null PyObject*, we
239
// return Py_None if the handle is null.
240
template <class T>
0 commit comments