* [PATCH] lei_saved_search: don't create Git object during ->DESTROY
@ 2023-11-22 21:24 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-11-22 21:24 UTC (permalink / raw)
To: meta
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(-)
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 {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-22 21:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 21:24 [PATCH] lei_saved_search: don't create Git object during ->DESTROY Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).