Skip to content

Commit

Permalink
remove redundant drain
Browse files Browse the repository at this point in the history
  • Loading branch information
cinchurge committed Mar 28, 2022
1 parent 004153a commit 7d13f32
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"})
}

Expand Down

0 comments on commit 7d13f32

Please sign in to comment.