mirror of
https://github.com/ruby/ruby.git
synced 2026-10-28 16:36:20 +08:00
Fix thread leaks
Wait for terminated threads to finish.
This commit is contained in:
1 file changed
+2
-6
@@ -924,15 +924,11 @@ class Socket < BasicSocket
|
||||
end
|
||||
end
|
||||
ensure
|
||||
hostname_resolution_threads.each do |thread|
|
||||
thread.exit
|
||||
end
|
||||
hostname_resolution_threads.each(&:exit).each(&:join)
|
||||
|
||||
hostname_resolution_result&.close
|
||||
|
||||
connecting_sockets.each_key do |connecting_socket|
|
||||
connecting_socket.close
|
||||
end
|
||||
connecting_sockets.each_key(&:close)
|
||||
end
|
||||
private_class_method :tcp_with_fast_fallback
|
||||
|
||||
|
||||
Reference in new issue
Block a user