From: Eric Wong Date: Wed, 22 Nov 2023 21:24:11 +0000 (+0000) Subject: lei_saved_search: don't create Git object during ->DESTROY X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=848f2d4a6fb618a92611dfd0c38ddab283332f44;p=thirdparty%2Fpublic-inbox.git lei_saved_search: don't create Git object during ->DESTROY This fixes t/lei-q-save.t getting stuck since $self->{ale} is already gone by the time DESTROY gets called. --- diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm index 2811c46dc..9ae9dcdb4 100644 --- a/lib/PublicInbox/LeiSavedSearch.pm +++ b/lib/PublicInbox/LeiSavedSearch.pm @@ -245,10 +245,10 @@ sub git { $_[0]->{git} //= PublicInbox::Git->new($_[0]->{ale}->git->{git_dir}) } sub pause_dedupe { my ($self) = @_; - git($self)->cleanup; - my $lockfh = delete $self->{lockfh}; # from lock_for_scope_fast; - my $oidx = delete($self->{oidx}) // return; - $oidx->commit_lazy; + my ($git, $oidx) = delete @$self{qw(git oidx)}; + $git->cleanup if $git; + $oidx->commit_lazy if $oidx; + delete $self->{lockfh}; # from lock_for_scope_fast; } sub reset_dedupe {