Fix crash when closing socket
This commit is contained in:
parent
8329b9c8b5
commit
19aa91eff2
@ -71,10 +71,8 @@ extension Player {
|
||||
guard let socket = socket else {
|
||||
return false
|
||||
}
|
||||
do {
|
||||
try socket.close().wait()
|
||||
} catch {
|
||||
print("Failed to close socket for player: \(name): \(error)")
|
||||
socket.close().whenFailure { [weak self] error in
|
||||
print("Failed to close socket for player: \(self?.name ?? "<Released>"): \(error)")
|
||||
}
|
||||
self.socket = nil
|
||||
return true
|
||||
|
Loading…
Reference in New Issue
Block a user