浏览代码

fix memory leak issue (#1069)

Zhixin Wen 7 年之前
父节点
当前提交
2e9f2912ba
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      conn.go

+ 2 - 0
conn.go

@@ -710,10 +710,12 @@ func (c *Conn) sendFrame(ctx context.Context, call *callReq, timeoutCh <-chan ti
 	case c.frameWriteArgChan <- call:
 		return nil
 	case <-timeoutCh:
+		c.releaseStream(call.streamID)
 		close(call.timeout)
 		c.handleTimeout()
 		return ErrTimeoutNoResponse
 	case <-ctxDone:
+		c.releaseStream(call.streamID)
 		close(call.timeout)
 		return ctx.Err()
 	case <-c.quit: