Browse Source

release buffer in error case

Darien Raymond 7 năm trước cách đây
mục cha
commit
8d09d74224
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      common/net/connection.go

+ 1 - 0
common/net/connection.go

@@ -117,6 +117,7 @@ func (c *connection) Write(b []byte) (int, error) {
 
 func (c *connection) WriteMultiBuffer(mb buf.MultiBuffer) error {
 	if c.done.Done() {
+		buf.ReleaseMulti(mb)
 		return io.ErrClosedPipe
 	}