Python C API: How to debug reference leak?

dieter dieter at handshake.de
Wed Sep 28 03:05:54 EDT 2016


dl l <ldlchina at gmail.com> writes:

> When I debug in C++, I see the reference count of a PyObject is 1. I don't
> know where is referencing this object. How can I find out where is
> referencing this object?

Likely, it is the reference, you are holding: typically, whenever
you can access a Python object, this object has at least reference count 1
(because it must lie on at least one access path -- the one used by you).




More information about the Python-list mailing list