How to check what is holding reference to object
duncan.booth at invalid.invalid
Tue Apr 27 23:21:28 CEST 2010
Michal M <mich.mierzwa at googlemail.com> wrote:
> 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:
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