From: Jesse Luehrs Date: Sun, 24 Apr 2011 15:12:03 +0000 (-0500) Subject: these aren't actually part of DEMOLISHALL X-Git-Tag: 2.0002~16 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=19f996daa10c250a51391051e7ec21427d32b829;p=gitmo%2FMoose.git these aren't actually part of DEMOLISHALL --- diff --git a/lib/Moose/Meta/Method/Destructor.pm b/lib/Moose/Meta/Method/Destructor.pm index e204e6d..182f15e 100644 --- a/lib/Moose/Meta/Method/Destructor.pm +++ b/lib/Moose/Meta/Method/Destructor.pm @@ -80,7 +80,9 @@ sub _initialize_body { 'my $self = shift;', 'return ' . $self->_generate_fallback_destructor('$self'), 'if Scalar::Util::blessed($self) ne \'' . $class . '\';', + 'local $?;', $self->_generate_DEMOLISHALL('$self'), + 'return;', '}', ); warn join("\n", @source) if $self->options->{debug}; @@ -115,7 +117,6 @@ sub _generate_DEMOLISHALL { return unless @methods; return ( - 'local $?;', 'my $igd = Devel::GlobalDestruction::in_global_destruction;', 'Try::Tiny::try {', (map { $inv . '->' . $_->{class} . '::DEMOLISH($igd);' } @methods), @@ -124,7 +125,6 @@ sub _generate_DEMOLISHALL { 'no warnings \'misc\';', 'die $_;', '};', - 'return;', ); }