Skip to content

Commit a3e4d1b

Browse files
committed
Close CDP socket listener thread before closing socket
Otherwise we are getting `IOError: stream closed in another thread` on quit.
1 parent 016eded commit a3e4d1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rb/lib/selenium/webdriver/devtools.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,19 @@ class DevTools
3232

3333
def initialize(url:)
3434
@callback_threads = ThreadGroup.new
35+
3536
@messages = []
3637
@session_id = nil
3738
@url = url
3839

3940
process_handshake
40-
attach_socket_listener
41+
@socket_thread = attach_socket_listener
4142
start_session
4243
end
4344

4445
def close
4546
@callback_threads.list.each(&:exit)
47+
@socket_thread.exit
4648
socket.close
4749
end
4850

0 commit comments

Comments
 (0)