# HG changeset patch # User Chris Jones # Date 1381977674 21600 # Node ID f59b79d032dac0a7686d46fae3ca748f2cf873f1 # Parent f4ccc2f297771e9a637c2c941302bf5bf2258a4d Make an attempt to only close the send channel if it's still open. diff -r f4ccc2f29777 -r f59b79d032da xmpp/xmpp.go --- a/xmpp/xmpp.go Wed Oct 16 20:29:29 2013 -0600 +++ b/xmpp/xmpp.go Wed Oct 16 20:41:14 2013 -0600 @@ -230,8 +230,13 @@ func (cl *Client) Close() { // Shuts down the receivers: cl.setStatus(StatusShutdown) + // Shuts down the senders: - close(cl.Send) + select { + case cl.Send <- &Iq{}: + close(cl.Send) + default: + } } // If there's a buffered error in the channel, return it. Otherwise,