diff options
author | Eric Wong <e@80x24.org> | 2023-11-22 21:24:11 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-22 22:16:36 +0000 |
commit | 848f2d4a6fb618a92611dfd0c38ddab283332f44 (patch) | |
tree | 7cac5d7490e89cbde41b19f2b87f8976cb939b62 /lib | |
parent | 19655cb200b8d0ecbd217d4c468bbba8d40ce014 (diff) | |
download | public-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')
-rw-r--r-- | lib/PublicInbox/LeiSavedSearch.pm | 8 |
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 { |