]> Sergey Matveev's repositories - public-inbox.git/commitdiff
lei_to_mail: drop cyclic reference if not using IPC
authorEric Wong <e@80x24.org>
Sat, 23 Jan 2021 10:27:48 +0000 (10:27 +0000)
committerEric Wong <e@80x24.org>
Sat, 23 Jan 2021 23:45:26 +0000 (23:45 +0000)
This may fix another interrupt-related segfault I'm occasionally
seeing (but so far unable to reproduce).

lib/PublicInbox/LeiToMail.pm

index 43c59da085e0e557df1a180780d5717e8af17a4b..438fb17582d9400467e0ffff9118e252795587c0 100644 (file)
@@ -483,11 +483,14 @@ sub ipc_atfork_prepare {
 # ordering is unstable at worker exit and may cause segfaults
 sub reap_gits {
        my ($self) = @_;
+       delete $self->{wcb};
        for my $git (delete @$self{grep(/\A$$\0/, keys %$self)}) {
                $git->async_wait_all;
        }
 }
 
+sub DESTROY { delete $_[0]->{wcb} }
+
 sub ipc_atfork_child { # runs after IPC::wq_worker_loop
        my ($self) = @_;
        $self->SUPER::ipc_atfork_child;