From f4098370ae844f6b08766cb50828caa0d511ce0a Mon Sep 17 00:00:00 2001 From: Jussi Holm Date: Thu, 7 May 2015 21:04:49 +0300 Subject: [PATCH] - close server message channel when connection is closed --- client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client.go b/client.go index 91402c9..d338fdc 100644 --- a/client.go +++ b/client.go @@ -465,6 +465,10 @@ func (c *ClientConn) mainLoop() { c.config.ServerMessageCh <- parsedMsg } + + if c.config.ServerMessageCh != nil { + close(c.config.ServerMessageCh) + } } func (c *ClientConn) readErrorReason() string {