mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 02:32:39 +01:00
cancel timers when a client quits
This commit is contained in:
parent
035a8f6cde
commit
e625f62baa
@ -103,9 +103,16 @@ func (client *Client) Destroy() error {
|
||||
if client.replies == nil {
|
||||
return ErrAlreadyDestroyed
|
||||
}
|
||||
|
||||
close(client.replies)
|
||||
client.replies = nil
|
||||
client.conn.Close()
|
||||
if client.idleTimer != nil {
|
||||
client.idleTimer.Stop()
|
||||
}
|
||||
if client.quitTimer != nil {
|
||||
client.quitTimer.Stop()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user