Browse Source

Merge pull request #855 from Zariel/timer-leak

conn: fix memory leak when using long timeouts
Chris Bannister 9 years ago
parent
commit
3305e81ff1
1 changed files with 4 additions and 0 deletions
  1. 4 0
      conn.go

+ 4 - 0
conn.go

@@ -536,6 +536,10 @@ func (c *Conn) releaseStream(stream int) {
 	delete(c.calls, stream)
 	c.mu.Unlock()
 
+	if call.timer != nil {
+		call.timer.Stop()
+	}
+
 	streamPool.Put(call)
 	c.streams.Clear(stream)
 }