From: gfx Date: Sat, 3 Oct 2009 05:57:05 +0000 (+0900) Subject: Fix previous changes X-Git-Tag: 0.37_02~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=e75f21db61e436b0a3646c6edba9a3d1aae7d696 Fix previous changes --- diff --git a/Makefile.PL b/Makefile.PL index ab6479f..df76048 100755 --- a/Makefile.PL +++ b/Makefile.PL @@ -54,6 +54,7 @@ sub create_moose_compatibility_test { '010-isa-or.t' => "Mouse has a [BUG]", '052-undefined-type-in-union.t' => "Mouse accepts undefined type as a member of union types", + '054-anon-leak.t' => 'Moose has memory leaks', '600-tiny-tiny.t' => "Moose doesn't support ::Tiny", '601-tiny-mouse.t' => "Moose doesn't support ::Tiny", diff --git a/lib/Mouse/Meta/Module.pm b/lib/Mouse/Meta/Module.pm index 6079af6..25831a9 100755 --- a/lib/Mouse/Meta/Module.pm +++ b/lib/Mouse/Meta/Module.pm @@ -266,16 +266,18 @@ sub get_method_list { return if !$serial_id; - @{$self->{superclasses}} = (); # clear @ISA - %{$self->namespace} = (); # clear the stash + # @ISA is a magical variable, so we clear it manually. + @{$self->{superclasses}} = () if exists $self->{superclasses}; + + # Then, clear the symbol table hash + %{$self->namespace} = (); my $name = $self->name; delete $METAS{$name}; - $name =~ s/::\d+$//; + $name =~ s/ $serial_id \z//xms; no strict 'refs'; - delete ${$name}{ $serial_id . '::' }; return;