]> ruin.nu Git - ndwebbie.git/commitdiff
Fixed a memory leak.
authorMichael Andreen <harv@ruin.nu>
Sun, 31 Aug 2008 10:45:32 +0000 (12:45 +0200)
committerMichael Andreen <harv@ruin.nu>
Sun, 31 Aug 2008 10:45:32 +0000 (12:45 +0200)
Don't trap the context in a closure. Also, better to just add the https
in production patch instead of checking for debug mode.

lib/NDWeb/Controller/Root.pm

index d337a297ead91a306a7f7acda5a4b138a106b08d..7d5bf1ca2a32e5f422b51ce69824afe4fa572b6d 100644 (file)
@@ -119,16 +119,17 @@ sub listAlliances : Private {
        $c->stash(alliances => \@alliances);
 }
 
+sub sslurl {
+       return $_[0];
+}
+
 sub auto : Private {
        my ($self, $c) = @_;
        my $dbh = $c ->model;
 
        $c->stash(dbh => $dbh);
 
-       $c->stash(sslurl => sub {
-                       $_[0]->scheme('https') unless $c->debug;
-                       return $_[0];
-               });
+       $c->stash(sslurl => \&sslurl);
 
        $dbh->do(q{SET timezone = 'GMT'});