From: Eric Wong Date: Thu, 31 Mar 2016 03:33:59 +0000 (+0000) Subject: httpd: remove reference to callback during close X-Git-Tag: v1.0.0~628 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=83a6b503812e4f17ea2eab10c7ae1ade6427f821 httpd: remove reference to callback during close Avoid wasting memory and the risk of a potential reference cycles by dropping the callback ASAP. --- diff --git a/script/public-inbox-httpd b/script/public-inbox-httpd index e7ed3c9d..3ca974c9 100755 --- a/script/public-inbox-httpd +++ b/script/public-inbox-httpd @@ -82,6 +82,12 @@ sub event_hup { $_[0]->{cb}->() } sub event_err { $_[0]->{cb}->() } sub sysread { shift->{sock}->sysread(@_) } +sub close { + my $self = shift; + $self->{cb} = undef; + $self->SUPER::close(@_); +} + 1; package PublicInbox::HTTPD;