From 7d13f329940cf2b5361cfbc56ecc25cdd8b10b2f Mon Sep 17 00:00:00 2001 From: Eric Chung Date: Mon, 28 Mar 2022 11:48:42 -0700 Subject: [PATCH] remove redundant drain --- connection.go | 8 -------- 1 file changed, 8 deletions(-) diff --git a/connection.go b/connection.go index d4233b44..152be2f8 100644 --- a/connection.go +++ b/connection.go @@ -900,14 +900,6 @@ func (c *Connection) close(fields ...LogField) error { // Close starts a graceful Close which will first reject incoming calls, reject outgoing calls // before finally marking the connection state as closed. func (c *Connection) Close() error { - // Remaining frames in sendCh must be drained and released, - // or we will leak frames - defer func() { - for len(c.sendCh) > 0 { - c.opts.FramePool.Release(<-c.sendCh) - } - }() - return c.close(LogField{"reason", "user initiated"}) }