From 573df2e74703d8a7c37f81456fd66e3d402c1ae7 Mon Sep 17 00:00:00 2001 From: astaxie Date: Wed, 26 Jun 2013 22:13:25 +0800 Subject: [PATCH] add isclose call close many times --- reload.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reload.go b/reload.go index 3d91b9f5..eb5f383e 100644 --- a/reload.go +++ b/reload.go @@ -27,12 +27,16 @@ var ErrInitStart = errors.New("init from") // Allows for us to notice when the connection is closed. type conn struct { net.Conn - wg *sync.WaitGroup + wg *sync.WaitGroup + isclose bool } func (c conn) Close() error { err := c.Conn.Close() - c.wg.Done() + if !c.isclose { + c.wg.Done() + c.isclose = true + } return err }