Skip to content

Commit 2b6abc3

Browse files
committed
fix(net): release URLSession on LKNetWSConnection deinit
1 parent 13b66c1 commit 2b6abc3

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Sources/LiveKit/Net/LKNetWSClient.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ final class LKNetWSConnection: WsConnection, @unchecked Sendable {
5656
}
5757
}
5858

59+
deinit {
60+
task.cancel(with: .normalClosure, reason: nil)
61+
session.invalidateAndCancel()
62+
}
63+
5964
func send(frame: Data) async throws {
6065
do {
6166
try await withCheckedThrowingContinuation { (cont: CheckedContinuation<Void, Error>) in

0 commit comments

Comments
 (0)