From e625f62baa3c0662ca07d88c56772ffbb1d4fe5d Mon Sep 17 00:00:00 2001 From: Jeremy Latt Date: Sun, 9 Feb 2014 19:06:30 -0800 Subject: [PATCH] cancel timers when a client quits --- irc/client.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/irc/client.go b/irc/client.go index 2d5a9e81..017dfac0 100644 --- a/irc/client.go +++ b/irc/client.go @@ -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 }