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 {
|
guard let socket = socket else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
do {
|
socket.close().whenFailure { [weak self] error in
|
||||||
try socket.close().wait()
|
print("Failed to close socket for player: \(self?.name ?? "<Released>"): \(error)")
|
||||||
} catch {
|
|
||||||
print("Failed to close socket for player: \(name): \(error)")
|
|
||||||
}
|
}
|
||||||
self.socket = nil
|
self.socket = nil
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user