From 10ee3548084c125f20fe2c830faea2a43413be92 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 23 Jun 2020 23:21:12 +0000 Subject: git_async_cat: remove circular reference While this circular reference was carefully managed to not leak memory; it was still triggering a warning at -imapd/-nntpd shutdown due to the EPOLL_CTL_DEL op failing after the $Epoll FD gets closed. So remove the circular reference by providing a ref to `undef', instead. --- lib/PublicInbox/NNTP.pm | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'lib/PublicInbox/NNTP.pm') diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 6df19f32..76f14bbd 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -553,8 +553,7 @@ sub cmd_article ($;$) { return $smsg unless ref $smsg; set_art($self, $art); $smsg->{nntp} = $self; - git_async_cat($self->{ng}->git, $smsg->{blob}, \&blob_cb, $smsg); - undef; + ${git_async_cat($self->{ng}->git, $smsg->{blob}, \&blob_cb, $smsg)}; } sub cmd_head ($;$) { @@ -564,8 +563,7 @@ sub cmd_head ($;$) { set_art($self, $art); $smsg->{nntp} = $self; $smsg->{nntp_code} = 221; - git_async_cat($self->{ng}->git, $smsg->{blob}, \&blob_cb, $smsg); - undef; + ${git_async_cat($self->{ng}->git, $smsg->{blob}, \&blob_cb, $smsg)}; } sub cmd_body ($;$) { @@ -575,8 +573,7 @@ sub cmd_body ($;$) { set_art($self, $art); $smsg->{nntp} = $self; $smsg->{nntp_code} = 222; - git_async_cat($self->{ng}->git, $smsg->{blob}, \&blob_cb, $smsg); - undef; + ${git_async_cat($self->{ng}->git, $smsg->{blob}, \&blob_cb, $smsg)}; } sub cmd_stat ($;$) { -- cgit v1.2.3-24-ge0c7