sub DEMOLISHALL {
my $self = shift;
+ my ($in_global_destruction) = @_;
# NOTE: we ask Perl if we even
# need to do this first, to avoid
|| Moose::Meta::Class->initialize( ref $self );
foreach my $method ( $meta->find_all_methods_by_name('DEMOLISH') ) {
- $method->{code}->execute($self);
+ $method->{code}->execute($self, $in_global_destruction);
}
}
# localize the $@ ...
local $@;
# run DEMOLISHALL ourselves, ...
- $_[0]->DEMOLISHALL;
+ $_[0]->DEMOLISHALL(Class::MOP::in_global_destruction);
# and return ...
return;
}
# otherwise it is normal destruction
- $_[0]->DEMOLISHALL;
+ $_[0]->DEMOLISHALL(Class::MOP::in_global_destruction);
}
# support for UNIVERSAL::DOES ...