- Notifications
You must be signed in to change notification settings - Fork587
Closed
Labels
Description
Description
Starting in v5.40, some closures leak memory despite there being no reference cycles.
Steps to Reproduce
#!/usr/bin/env perluse v5.38;use Scalar::Utilqw(weaken);my$wref;{my$x;my$subject =sub {$x =$_[0];my$y;returnsub {$y }; };my$subscriber = {}; weaken($wref =$subscriber);$subscriber->{foo} =$subject->($subscriber);}!defined$wrefordie"Leak";
$ perl bleak.pl Leak at bleak.pl line 18.$
This used to work in v5.38. It is broken in v5.40 and blead.
Expected behavior
$ perl bleak.pl$