From ff64efb53e6b0c64bf7f6f77470f402939c9333a Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Sun, 31 Aug 2008 12:45:32 +0200 Subject: [PATCH] Fixed a memory leak. 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/NDWeb/Controller/Root.pm b/lib/NDWeb/Controller/Root.pm index d337a29..7d5bf1c 100644 --- a/lib/NDWeb/Controller/Root.pm +++ b/lib/NDWeb/Controller/Root.pm @@ -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'}); -- 2.39.2