1 package Mouse::Meta::Method::Destructor;
2 use Mouse::Util; # 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) {
17 if (*{$class . '::DEMOLISH'}{CODE}) {
18 $demolishall .= "${class}::DEMOLISH(\$self);\n";
22 my $source = sprintf("#line %d %s\n", __LINE__, __FILE__) . <<"...";
35 die \$e if \$e; # rethrow
54 Mouse::Meta::Method::Accessor - A Mouse method generator for destructors
58 This document describes Mouse version 0.38
62 L<Moose::Meta::Method::Destructor>