Explorar o código

Merge pull request #855 from Zariel/timer-leak

conn: fix memory leak when using long timeouts
Chris Bannister %!s(int64=9) %!d(string=hai) anos
pai
achega
3305e81ff1
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  1. 4 0
      conn.go

+ 4 - 0
conn.go

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