3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-13 07:29:30 +01:00

cancel timers when a client quits

This commit is contained in:
Jeremy Latt 2014-02-09 19:06:30 -08:00
parent 035a8f6cde
commit e625f62baa

View File

@ -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
}