use strict; use WeakRef; while(1) { &leak(); } sub leak { my $sub_ref; $sub_ref = sub { &$sub_ref(); }; weaken($sub_ref); # <- This fixes the leak return 0; }
In reply to Re: Re: Memory leak on definition of anonymous code?
by tilly
in thread Memory leak on definition of anonymous code?
by octothorpe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |