diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-13 10:41:40 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-13 10:41:40 +0100 |
commit | 7c70814d3fbb3188e17f35f2ddd42354f610e3fa (patch) | |
tree | e01691284cb3e17be4a631394c0e2f5dba492830 | |
parent | e1a078d41d5b3be4fd45f2fdcedef69d8660dac7 (diff) |
remove cobrand reference to stop circular references
-rw-r--r-- | perllib/FixMyStreet/App.pm | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 3aa81bd2b..b5838a169 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -385,6 +385,16 @@ sub uri_for_email { return URI->new($email_uri); } +sub finalize { + my $c = shift; + $c->next::method(@_); + + # cobrand holds on to a reference to $c so we want to + # get git rid of this to stop circular references and + # memory leaks + delete $c->stash->{cobrand}; +} + =head1 SEE ALSO L<FixMyStreet::App::Controller::Root>, L<Catalyst> |