mysql.rb ignores IOError in finalizer when socket is already closed

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6241 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper 2007-02-26 21:40:50 +00:00
parent b8cd80550f
commit 9ea68721ac
1 changed files with 5 additions and 1 deletions

View File

@ -1174,7 +1174,11 @@ class << Mysql
def finalizer(net)
proc {
net.clear
net.write Mysql::COM_QUIT.chr
begin
net.write(Mysql::COM_QUIT.chr)
net.close
rescue # Ignore IOError if socket is already closed.
end
}
end