mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 10:10:08 -08:00
cancel timers when a client quits
This commit is contained in:
parent
035a8f6cde
commit
e625f62baa
1 changed files with 7 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue