3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-10 22:19:31 +01:00

don't close replies twice

This commit is contained in:
Jeremy Latt 2014-02-13 20:56:15 -08:00
parent be01a412d9
commit 7cef494d28

View File

@ -128,10 +128,14 @@ func (client *Client) writeReplies() {
}
if client.socket.Write(reply.Format(client)) != nil {
close(client.replies)
break
}
}
client.replies = nil
if client.replies != nil {
close(client.replies)
client.replies = nil
}
}
func (client *Client) Destroy() {
@ -147,6 +151,7 @@ func (client *Client) Destroy() {
if client.replies != nil {
close(client.replies)
client.replies = nil
}
client.socket.Close()