develooper Front page | perl.perl5.porters | Postings from January 2012

Re: [perl #109270] leak on accessing anon sub inside another one

Thread Previous
From:
Alexandr Gomoliako
Date:
January 29, 2012 12:05
Subject:
Re: [perl #109270] leak on accessing anon sub inside another one
Message ID:
CAKb9G9iL9i3R4tmXXw-zUPsphUp5qZrnF37F5ReD=h-jG89dKQ@mail.gmail.com
On Sun, Jan 29, 2012 at 7:45 PM, James E Keenan via RT
<perlbug-followup@perl.org> wrote:
> On Sun Jan 29 03:41:06 2012, LeonT wrote:

>> This is called a circular reference, and this kind of leaking is a
>> well known consequence of reference counting. If you want this not to
>> happen, try weakening one of the references.

> Do the attached programs correctly document how to do this?

Thank you, Jim, I understand how weaken works and it fixes the leak
here, but it doesn't help much in my program. I guess I should have
described it differently. In short: I want to keep $foo alive outside
of the scope, but it will get destroyed with weaken.

> If so, is the ticket closable?

Of course, since it's known thing.
Thank you for your help.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About