X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FMethod%2FDestructor.pm;h=b91ed2ae5e61d1bbb777833560b1b87d04a1b09b;hb=4aaed9e5cc435a2085e46f4c98a3abc233ecacaf;hp=b83c71b4bb7620e26cbd6500adfaebfa2edc8134;hpb=5124b7171ce498f9bb43befc007d9248817d6454;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Method/Destructor.pm b/lib/Mouse/Meta/Method/Destructor.pm index b83c71b..b91ed2a 100644 --- a/lib/Mouse/Meta/Method/Destructor.pm +++ b/lib/Mouse/Meta/Method/Destructor.pm @@ -1,5 +1,5 @@ package Mouse::Meta::Method::Destructor; -use Mouse::Util qw(get_code_ref); # enables strict and warnings +use Mouse::Util qw(:meta); # enables strict and warnings sub _empty_DESTROY{ } @@ -12,8 +12,9 @@ sub _generate_destructor{ my $demolishall = ''; for my $class ($metaclass->linearized_isa) { - if (get_code_ref($class, 'DEMOLISH')) { - $demolishall .= "${class}::DEMOLISH(\$self);\n"; + if (Mouse::Util::get_code_ref($class, 'DEMOLISH')) { + $demolishall .= sprintf "%s::DEMOLISH(\$self, \$Mouse::Util::in_global_destruction);\n", + $class, } } @@ -53,7 +54,7 @@ Mouse::Meta::Method::Destructor - A Mouse method generator for destructors =head1 VERSION -This document describes Mouse version 0.40 +This document describes Mouse version 0.50_02 =head1 SEE ALSO