X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FModule.pm;h=4e0cfa86c39304ba262908cb1635764fe18057ab;hb=20a12328ad6513c41ba0856f5d8d95aba672165b;hp=b1b7ab6bfc687fdafd7eb3d8b4f772936fab5351;hpb=3823fbc79ecaa60928ccd620fe68454ea6de265e;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Module.pm b/lib/Mouse/Meta/Module.pm index b1b7ab6..4e0cfa8 100755 --- a/lib/Mouse/Meta/Module.pm +++ b/lib/Mouse/Meta/Module.pm @@ -283,6 +283,13 @@ sub DESTROY{ return if !$serial_id; # mortal anonymous class + # XXX: cleaning stash with threads causes panic/SEGV. + if(exists $INC{'threads.pm'}) { + # (caller)[2] indicates the caller's line number, + # which is zero when the current thread is joining. + return if( (caller)[2] == 0); + } + # @ISA is a magical variable, so we clear it manually. @{$self->{superclasses}} = () if exists $self->{superclasses}; @@ -293,7 +300,6 @@ sub DESTROY{ delete $METAS{$name}; $name =~ s/ $serial_id \z//xms; - no strict 'refs'; delete ${$name}{ $serial_id . '::' };