Python C API: How to debug reference leak?

Gregory Ewing greg.ewing at canterbury.ac.nz
Wed Sep 28 07:25:31 EDT 2016


Chris Angelico wrote:
> If you've Py_DECREFed it and then peek into its internals, you're
> aiming a gun at your foot.

That's true. A safer way would be to look at the refcount
*before* decreffing and verify that it's what you expect.

-- 
Greg



More information about the Python-list mailing list