How to check what is holding reference to object

Duncan Booth duncan.booth at invalid.invalid
Tue Apr 27 23:21:28 CEST 2010


Michal M <mich.mierzwa at googlemail.com> wrote:

> Hi
> 
> I've just found out that one of objects is not destroyed when it
> should be. This means that something was holding reference to this
> object or part of it (i.e. method). Is there any way to check what
> holds that reference? I am unable to do that just looking to the code
> or debugging it because it is pretty complicated, but I am able to
> invoke this situation again.
> 
See if this code helps:

http://groups.google.com/group/comp.lang.python/browse_thread/thread/394ba5b48f83ebfb/237dc92f3629dd9a#237dc92f3629dd9a

It's pretty old so it may need some adjustment, but I wrote it
to figure out exactly that sort of problem.



More information about the Python-list mailing list