in reply to Re: Closures, object destruction and memory leaks
in thread Closures, object destruction and memory leaks

I _think_ the memory leak you mean only comes up with recursive closures:

my $foo; $foo=sub { $foo->(@_[1..$#_]) if @_ }; $foo->();

But like you I dont remember the details...


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi


Replies are listed 'Best First'.
Re: Re: Re: Closures, object destruction and memory leaks
by tilly (Archbishop) on Nov 10, 2003 at 18:27 UTC
    Recursive closures leak memory. That is documented and the fix is to use WeakRef.

    What I am talking about is an actual bug, and I darned well know that it was there in 5.005_03 because I encountered it and had to fix a bunch of code that was leaking memory too fast.