Skip to content

Commit

Permalink
Add finalizer to Client to avoid shutdown callback being called after…
Browse files Browse the repository at this point in the history
… socket has gone out of scope
  • Loading branch information
quinnj committed Sep 29, 2024
1 parent f43a14b commit 5330787
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/sockets/client.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ mutable struct Client <: IO
)
aws_client_bootstrap_new_socket_channel(FieldRef(x, :bootstrap)) != 0 && throw(ClientError("failed to create socket"))
@assert take!(x.ch) == :setup "failed to create socket" # wait for connection
finalizer(close, x)
return x
end
end
Expand Down

0 comments on commit 5330787

Please # to comment.