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

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

Thread Previous
Alexandr Gomoliako
January 29, 2012 12:05
Re: [perl #109270] leak on accessing anon sub inside another one
Message ID:
On Sun, Jan 29, 2012 at 7:45 PM, James E Keenan via RT
<> 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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About