From: Christian Hansen Date: Wed, 30 Mar 2005 14:16:06 +0000 (+0000) Subject: call only the closes default and reverse end calls X-Git-Tag: 5.7099_04~1649 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=b96d41e6a80ff8d00e4030e55c0fc1ae8c11aa76 call only the closes default and reverse end calls --- diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 8d84e85..ba926cb 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -373,11 +373,11 @@ sub handler ($$) { for my $begin ( @{ $c->get_action( 'begin', $namespace ) } ) { $c->state( $c->execute( @{ $begin->[0] } ) ); } - for my $result ( @{ $c->get_action( $action, $default ) } ) { + for my $result ( @{ $c->get_action( $action, $default ) }[-1] ) { $c->state( $c->execute( @{ $result->[0] } ) ); last unless $default; } - for my $end ( @{ $c->get_action( 'end', $namespace ) } ) { + for my $end ( reverse @{ $c->get_action( 'end', $namespace ) } ) { $c->state( $c->execute( @{ $end->[0] } ) ); } }