Fix thread leaks

Wait for terminated threads to finish.
This commit is contained in:
Nobuyoshi Nakada committed 2026-04-09 14:19:02 +09:00
1 parent 4b6a467a4a
commit c091c186e4
1 file changed
+2 -6
+2 -6
View File
@@ -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