File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ function Base.run(x::JSONRPCEndpoint)
106106 else
107107 Base. display_error (stderr , err, bt)
108108 end
109+ finally
110+ close (x. out_msg_queue)
109111 end
110112
111113 x. read_task = @async try
@@ -143,6 +145,8 @@ function Base.run(x::JSONRPCEndpoint)
143145 else
144146 Base. display_error (stderr , err, bt)
145147 end
148+ finally
149+ close (x. in_msg_queue)
146150 end
147151
148152 x. status = :running
@@ -233,8 +237,8 @@ function Base.close(endpoint::JSONRPCEndpoint)
233237 flush (endpoint)
234238
235239 endpoint. status = :closed
236- close (endpoint. in_msg_queue)
237- close (endpoint. out_msg_queue)
240+ isopen (endpoint . in_msg_queue) && close (endpoint. in_msg_queue)
241+ isopen (endpoint . out_msg_queue) && close (endpoint. out_msg_queue)
238242
239243 fetch (endpoint. write_task)
240244 # TODO we would also like to close the read Task
You can’t perform that action at this time.
0 commit comments