about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiSavedSearch.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-22 21:24:11 +0000
committerEric Wong <e@80x24.org>2023-11-22 22:16:36 +0000
commit848f2d4a6fb618a92611dfd0c38ddab283332f44 (patch)
tree7cac5d7490e89cbde41b19f2b87f8976cb939b62 /lib/PublicInbox/LeiSavedSearch.pm
parent19655cb200b8d0ecbd217d4c468bbba8d40ce014 (diff)
downloadpublic-inbox-848f2d4a6fb618a92611dfd0c38ddab283332f44.tar.gz
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.
Diffstat (limited to 'lib/PublicInbox/LeiSavedSearch.pm')
-rw-r--r--lib/PublicInbox/LeiSavedSearch.pm8
1 files changed, 4 insertions, 4 deletions
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 {