summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-23 21:30:33 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-23 21:30:33 +0000
commite15faf7d09c73a41f95fbe6a0045ad5b17c899a6 (patch)
tree63afe41128dd7c7aaaf6effdfaa6ab9d91145647 /t
parent8772537cf6d022a54f738ccb84b65a7f21ccf1b2 (diff)
downloadperl-e15faf7d09c73a41f95fbe6a0045ad5b17c899a6.tar.gz
Remove the reference loop between symbol tables and typeglobs.
Typeglobs now have a weak reference onto their symbol table. p4raw-id: //depot/perl@24966
Diffstat (limited to 't')
-rwxr-xr-xt/op/gv.t15
1 files changed, 14 insertions, 1 deletions
diff --git a/t/op/gv.t b/t/op/gv.t
index 655e6246ba..66c1cfd03d 100755
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -12,7 +12,7 @@ BEGIN {
use warnings;
require './test.pl';
-plan( tests => 66 );
+plan( tests => 68 );
# type coersion on assignment
$foo = 'foo';
@@ -246,6 +246,19 @@ is($j[0], 1);
is($x, "rocks\n");
}
+{
+ my $output = runperl(prog => <<'EOPROG', stderr => 1);
+package M;
+sub DESTROY {warn "Farewell $_[0]"}
+package main;
+
+bless \$A::B, 'M';
+*A:: = \*B::;
+EOPROG
+ like($output, qr/^Farewell M=SCALAR/, "DESTROY was called");
+ unlike($output, qr/global destruction/,
+ "unreferenced symbol tables should be cleaned up immediately");
+}
__END__
Perl
Rules