Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: How to avoid closures and memory leaks.

by ikegami (Patriarch)
on Oct 19, 2014 at 05:51 UTC ( [id://1104288]=note: print w/replies, xml ) Need Help??


in reply to How to avoid closures and memory leaks.

What memory leak? There's no memory leak in what you posted, and there's no mention of memory leaks in the document you mention as the basis for this.

This is how you get a memory leak from a closure:

my $foo; $foo = sub { ... $foo->() ... };

The sub reference $foo, and $foo is a reference to the sub. But you don't have that.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1104288]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-24 20:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found