disconnect: Clear callbacks before closing channels

이 커밋은 다음에 포함됨:
Chance Zibolski
2014-07-14 17:05:27 -07:00
부모 846881130f
커밋 06fee2df7d
+4
파일 보기
@@ -289,6 +289,10 @@ func (irc *Connection) ErrorChan() chan error {
// A disconnect sends all buffered messages (if possible),
// stops all goroutines and then closes the socket.
func (irc *Connection) Disconnect() {
for event := range irc.events {
irc.ClearCallback(event)
}
close(irc.end)
close(irc.pwrite)