diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net/imap.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/net/imap.rb b/lib/net/imap.rb index 0f6a4372d5..3404700297 100644 --- a/lib/net/imap.rb +++ b/lib/net/imap.rb @@ -311,7 +311,11 @@ module Net @receiver_thread.raise(e) end @receiver_thread.join - @sock.close + synchronize do + unless @sock.closed? + @sock.close + end + end raise e if e end |