Subject: | Mail::Box::MH::readMessages leaves the folder locked |
The Mail::Box::MH::readMessages function locks the mailbox, but never unlocks it. The following simple fragment illustrates the bug:
use Mail::Box::Manager;
my $mgr = Mail::Box::Manager->new();
my $folder = $mgr->open(type => 'mh', folder => $folder)
$folder->addMessage($msg)
The addMessage call would produce the "Folder already locked" warning.
A trivial patch is attached.
Subject: | 0001-Mail-Box-MH-readMessages-unlock-the-mailbox.patch |
From c7939ba162927ca01b0eb02b8a2e316514063688 Mon Sep 17 00:00:00 2001
From: Sergey Poznyakoff <gray@gnu.org>
Date: Fri, 26 Jul 2019 15:51:31 +0300
Subject: [PATCH] Mail::Box::MH::readMessages: unlock the mailbox
* lib/Mail/Box/MH.pm (readMessages): Unlock the mailbox prior to return
return.
---
lib/Mail/Box/MH.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/Mail/Box/MH.pm b/lib/Mail/Box/MH.pm
index 41b74a3..2ed3acc 100644
--- a/lib/Mail/Box/MH.pm
+++ b/lib/Mail/Box/MH.pm
@@ -464,6 +464,7 @@ sub readMessages(@)
}
$self->{MBM_highest_msgnr} = $msgnrs[-1];
+ $locker->unlock;
$self;
}
--
2.14.5