about summary refs log tree commit homepage
diff options
context:
space:
mode:
-rw-r--r--lib/PublicInbox/Inbox.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm
index 3f1b7334..34191fc7 100644
--- a/lib/PublicInbox/Inbox.pm
+++ b/lib/PublicInbox/Inbox.pm
@@ -5,7 +5,7 @@
 package PublicInbox::Inbox;
 use strict;
 use warnings;
-use Scalar::Util qw(weaken);
+use Scalar::Util qw(weaken isweak);
 use PublicInbox::Git;
 use PublicInbox::MID qw(mid2path);
 
@@ -19,7 +19,9 @@ sub new {
 
 sub weaken_all {
         my ($self) = @_;
-        weaken($self->{$_}) foreach qw(git mm search);
+        foreach my $f (qw(git mm search)) {
+                isweak($self->{$f}) or weaken($self->{$f});
+        }
 }
 
 sub git {