From 848f2d4a6fb618a92611dfd0c38ddab283332f44 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 22 Nov 2023 21:24:11 +0000 Subject: 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. --- lib/PublicInbox/LeiSavedSearch.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm index 2811c46d..9ae9dcdb 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 { -- cgit v1.2.3-24-ge0c7