Fixed memory leak
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index 0aeefac..17b0d4a 100644 (file)
@@ -167,7 +167,7 @@ sub execute {
             push @{ $c->{stats} }, [ $action, sprintf( '%fs', $elapsed ) ];
             $c->state(@state);
         }
-        else { $c->state( &$code( $class, $c, @{ $c->req->args } ) ) }
+        else { $c->state( &$code( $class, $c, @{ $c->req->args } ) ? 1 : 0 ) }
     };
 
     if ( my $error = $@ ) {
@@ -219,6 +219,10 @@ sub finalize {
     return $status;
 }
 
+=item $c->finalize_output
+
+<obsolete>, see finalize_body
+
 =item $c->finalize_body
 
 Finalize body.
@@ -463,10 +467,9 @@ sub prepare {
 
     my $method   = $c->req->method   || '';
     my $path     = $c->req->path     || '';
-    my $hostname = $c->req->hostname || '';
     my $address  = $c->req->address  || '';
 
-    $c->log->debug(qq/"$method" request for "$path" from $hostname($address)/)
+    $c->log->debug(qq/"$method" request for "$path" from $address/)
       if $c->debug;
 
     if ( $c->request->method eq 'POST' and $c->request->content_length ) {
@@ -623,35 +626,6 @@ Prepare uploads.
 
 sub prepare_uploads { }
 
-=item $c->retrieve_components
-
-Retrieve Components.
-
-=cut
-
-sub retrieve_components {
-    my $self = shift;
-
-    my $class = ref $self || $self;
-    eval <<"";
-        package $class;
-        import Module::Pluggable::Fast
-          name    => '_components',
-          search  => [
-            '$class\::Controller', '$class\::C',
-            '$class\::Model',      '$class\::M',
-            '$class\::View',       '$class\::V'
-          ],
-          require => 1;
-
-    if ( my $error = $@ ) {
-        chomp $error;
-        die qq/Couldn't load components "$error"/;
-    }
-
-    return $self->_components;
-}
-
 =item $c->run
 
 Starts the engine.
@@ -701,7 +675,7 @@ Setup components.
 
 sub setup_components {
     my $self = shift;
-
+    
     # Components
     my $class = ref $self || $self;
     eval <<"";