diff --git a/ChangeLog b/ChangeLog index 82cff7e61f..3e7aa70c6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed May 19 23:19:30 2010 Shugo Maeda + + * lib/net/imap.rb (disconnect): closes the socket of a Net::IMAP + object only when it is not closed. [ruby-dev:41350] + Wed May 19 20:09:38 2010 Yusuke Endoh * vm_eval.c (rb_f_caller): return [] instead of nil when the function 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