mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-25 21:39:25 +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 {
|
if client.replies == nil {
|
||||||
return ErrAlreadyDestroyed
|
return ErrAlreadyDestroyed
|
||||||
}
|
}
|
||||||
|
|
||||||
close(client.replies)
|
close(client.replies)
|
||||||
client.replies = nil
|
client.replies = nil
|
||||||
client.conn.Close()
|
client.conn.Close()
|
||||||
|
if client.idleTimer != nil {
|
||||||
|
client.idleTimer.Stop()
|
||||||
|
}
|
||||||
|
if client.quitTimer != nil {
|
||||||
|
client.quitTimer.Stop()
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user