1 package Mouse::Meta::Method::Destructor;
2 use Mouse::Util qw(get_code_ref); # enables strict and warnings
6 sub _generate_destructor{
7 my (undef, $metaclass) = @_;
9 if(!$metaclass->name->can('DEMOLISH')){
10 return \&_empty_DESTROY;
14 for my $class ($metaclass->linearized_isa) {
15 if (get_code_ref($class, 'DEMOLISH')) {
16 $demolishall .= "${class}::DEMOLISH(\$self);\n";
20 my $source = sprintf("#line %d %s\n", __LINE__, __FILE__) . <<"...";
33 die \$e if \$e; # rethrow
52 Mouse::Meta::Method::Destructor - A Mouse method generator for destructors
56 This document describes Mouse version 0.40_01
60 L<Moose::Meta::Method::Destructor>