Skip to content

Commit

Permalink
fix: shutdown multithreaded eventloop group on deinit (#152)
Browse files Browse the repository at this point in the history
* fix: shutdown multithreaded eventloop group on deinit

* fix: bump swift version
  • Loading branch information
koraykoska authored Feb 19, 2023
1 parent 1fa4b47 commit 3c9b29a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.6.3
5.7.3
3 changes: 3 additions & 0 deletions Sources/FoundationHTTP/Web3WebSocketProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ public class Web3WebSocketProvider: Web3Provider, Web3BidirectionalProvider {
deinit {
closed = true
_ = webSocket.close(code: .goingAway)

// As described in https://github.com/apple/swift-nio/issues/2371
try? wsEventLoopGroup.syncShutdownGracefully()
}

// MARK: - Web3Provider
Expand Down

0 comments on commit 3c9b29a

Please sign in to comment.