From: Karsten Sperling Date: Mon, 10 Jul 2000 15:12:52 +0000 (+0200) Subject: [ID 20000710.002] fatal error or memory loss when deleting symbols in evaled code... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cc9be7ab225b8bf6eb0505b0cc48a1c378496aea;p=p5sagit%2Fp5-mst-13.2.git [ID 20000710.002] fatal error or memory loss when deleting symbols in evaled code with syntax errors To: perl5-porters@perl.org Message-Id: <200007101315.e6ADFrg21041@chthon.perl.com> p4raw-id: //depot/cfgperl@6342 --- diff --git a/lib/Symbol.pm b/lib/Symbol.pm index a842c1c..a95383a 100644 --- a/lib/Symbol.pm +++ b/lib/Symbol.pm @@ -129,8 +129,15 @@ sub delete_package ($) { my $stem_symtab = *{$stem}{HASH}; return unless defined $stem_symtab and exists $stem_symtab->{$leaf}; - my $leaf_glob = $stem_symtab->{$leaf}; - my $leaf_symtab = *{$leaf_glob}{HASH}; + + # free all the symbols in the package + + my $leaf_symtab = *{$stem_symtab->{$leaf}}{HASH}; + foreach my $name (keys %$leaf_symtab) { + undef *{$pkg . $name}; + } + + # delete the symbol table %$leaf_symtab = (); delete $stem_symtab->{$leaf};