On Thu, May 20, 2010 at 6:54 PM, Ilya Sterin <ster...@gmail.com> wrote:
> Looking at devel::peek, I can see what seems to be list of referents
> to the object, so that information is I believe maintained.  What I'd
> love to find out whether it's possible, is for me to walk the list of
> graph of referents and replace all references to the object being
> destroy with a proxy and then allow the object to go out of scope.

I'm not totally sure what you're up to here, but I think a module I
wrote a ways back may help.  I wrote it specifically for walking
blessed objects to check for leaks and things.  I meant it for use
during testing, but there's no reason you couldn't use it to audit
memory structures to kill leakers.  Arguably it'd be better to find
and stop the leaks, but if that's not realistic, this may help.

http://search.cpan.org/perldoc?Devel::FindBlessedRefs

I'm also not totally clear, as you mentioned weakening refs, why
hasn't weakening the refs worked for you?  Did you mean this:
http://search.cpan.org/~gbarr/Scalar-List-Utils-1.23/lib/Scalar/Util.pm#weaken_REF?
 That should work...

-- 
If riding in an airplane is flying, then riding in a boat is swimming.
114 jumps, 47.2 minutes of freefall, 90.4 freefall miles.

Reply via email to