diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-01-25 12:00:04 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-01-25 12:00:04 +0000 |
commit | 154b970cb4fe96ef863c55bd5e330d17252e0208 (patch) | |
tree | 1a1c6119ff5190b4d2f2cbde9f1b790256cae275 /t/op/closure.t | |
parent | 5c41a5fa918d32924e1ac2f02418d5d7f465ef26 (diff) | |
download | perl-154b970cb4fe96ef863c55bd5e330d17252e0208.tar.gz |
add test for change 22209 (Remove small memory leak in newATTRSUB)
p4raw-id: //depot/perl@22215
Diffstat (limited to 't/op/closure.t')
-rwxr-xr-x | t/op/closure.t | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/t/op/closure.t b/t/op/closure.t index f9da3114e7..4d560f6119 100755 --- a/t/op/closure.t +++ b/t/op/closure.t @@ -13,7 +13,7 @@ BEGIN { use Config; -print "1..186\n"; +print "1..187\n"; my $test = 1; sub test (&) { @@ -678,6 +678,23 @@ __EOF__ test { $got eq 'ok' }; } +# After newsub is redefined outside the BEGIN, it's CvOUTSIDE should point +# to main rather than BEGIN, and BEGIN should be freed. + +{ + my $flag = 0; + sub X::DESTROY { $flag = 1 } + { + my $x; + BEGIN {$x = \&newsub } + sub newsub {}; + $x = bless {}, 'X'; + } + test { $flag == 1 }; +} + + + |