Browse Source

dont close the channel, store not waiting

Chris Bannister 10 years ago
parent
commit
9262dc285f
1 changed files with 1 additions and 2 deletions
  1. 1 2
      conn.go

+ 1 - 2
conn.go

@@ -611,12 +611,11 @@ func (c *Conn) closeWithError(err error) {
 		req := &c.calls[id]
 		// we need to send the error to all waiting queries, put the state
 		// of this conn into not active so that it can not execute any queries.
+		atomic.StoreInt32(&req.waiting, 0)
 		select {
 		case req.resp <- err:
 		default:
 		}
-
-		close(req.resp)
 	}
 
 	c.conn.Close()