Python C API: How to debug reference leak?

Gregory Ewing greg.ewing at canterbury.ac.nz
Wed Sep 28 04:56:37 EDT 2016


dieter wrote:
> dl l <ldlchina at gmail.com> writes:
> 
>>When I debug in C++, I see the reference count of a PyObject is 1.
 >> How can I find out where is referencing this object?
> 
> Likely, it is the reference, you are holding:

Unless you've just Py_DECREFed it, expecting it to go
away, and the recfcount is still 1, in which case there's
still another reference somewhere else.

-- 
Greg



More information about the Python-list mailing list