Avoid calling disconnect twice

This commit is contained in:
Leon Böttger committed 2025-05-30 19:33:09 +02:00
1 parent f3f6616280
commit 20af028cc3
1 file changed
+2 -1
+2 -1
View File
@@ -411,9 +411,10 @@ class NearbyConnection {
func disconnect() {
connection.send(content: nil, isComplete: true, completion: .contentProcessed { _ in
self.handleConnectionClosure()
})
self.handleConnectionClosure()
connectionClosed = true
connection.stateUpdateHandler = nil
}
func sendDisconnectionAndDisconnect() throws {