소스 검색

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: