about summary refs log tree commit homepage
path: root/script/public-inbox-httpd
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-03-31 03:33:59 +0000
committerEric Wong <e@80x24.org>2016-03-31 03:34:18 +0000
commit83a6b503812e4f17ea2eab10c7ae1ade6427f821 (patch)
tree62d1962010595742423e47516e55ab95dd0c770d /script/public-inbox-httpd
parent8c56a2317a3daca70d0e35c0e38b4b15be4823a8 (diff)
downloadpublic-inbox-83a6b503812e4f17ea2eab10c7ae1ade6427f821.tar.gz
Avoid wasting memory and the risk of a potential reference
cycles by dropping the callback ASAP.
Diffstat (limited to 'script/public-inbox-httpd')
-rwxr-xr-xscript/public-inbox-httpd6
1 files changed, 6 insertions, 0 deletions
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;