Mouse
view release on metacpan or search on metacpan
lib/Mouse/Meta/Module.pm view on Meta::CPAN
sub DESTROY{
my($self) = @_;
return if Mouse::Util::in_global_destruction();
my $serial_id = $self->{anon_serial_id};
return if !$serial_id;
# XXX: cleaning stash with threads causes panic/SEGV on legacy perls.
if(exists $INC{'threads.pm'}) {
# (caller)[2] indicates the caller's line number,
# which is zero when the current thread is joining (destroying).
return if( (caller)[2] == 0);
}
# clean up mortal anonymous class stuff
# @ISA is a magical variable, so we must clear it manually.
@{$self->{superclasses}} = () if exists $self->{superclasses} && scalar(@{$self->{superclasses}}) > 0;
# Then, clear the symbol table hash
%{$self->namespace} = ();
( run in 0.657 second using v1.01-cache-2.11-cpan-a3c8064c92c )