We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aaf0d22 commit bc2f77aCopy full SHA for bc2f77a
include/boost/python/object_core.hpp
@@ -422,6 +422,7 @@ inline api::object_base& api::object_base::operator=(api::object_base const& rhs
422
423
inline api::object_base::~object_base()
424
{
425
+ assert( Py_REFCNT(m_ptr) > 0 );
426
Py_DECREF(m_ptr);
427
}
428
include/boost/python/refcount.hpp
@@ -27,12 +27,14 @@ inline T* xincref(T* p)
27
template <class T>
28
inline void decref(T* p)
29
30
+ assert( Py_REFCNT(python::upcast<PyObject>(p)) > 0 );
31
Py_DECREF(python::upcast<PyObject>(p));
32
33
34
35
inline void xdecref(T* p)
36
37
+ assert( !p || Py_REFCNT(python::upcast<PyObject>(p)) > 0 );
38
Py_XDECREF(python::upcast<PyObject>(p));
39
40
0 commit comments