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.
In reply to Re: How to avoid closures and memory leaks.
by ikegami
in thread How to avoid closures and memory leaks.
by runnerup
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |