Skip to content

Commit

Permalink
Clear $trace before returning so method args in Server should be corr…
Browse files Browse the repository at this point in the history
…ectly garbage collected. (Thanks to chiba and Sartak)
  • Loading branch information
miyagawa committed Dec 11, 2009
1 parent 8f3711b commit 4afa7b5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Plack/Middleware/StackTrace.pm
Expand Up @@ -31,6 +31,11 @@ sub call {
$res = [500, ['Content-Type' => 'text/html; charset=utf-8'], [ $body ]];
}

# break $trace here since $SIG{__DIE__} holds the ref to it, and
# $trace has refs to Standalone.pm's args ($conn etc.) and
# prevents garbage collection to be happening.
undef $trace;

return $res;
}

Expand Down

0 comments on commit 4afa7b5

Please sign in to comment.