Skip to content

Commit

Permalink
netconn.go: Prevent timer leakage (#255)
Browse files Browse the repository at this point in the history
Closes #243
  • Loading branch information
nhooyr authored Jul 5, 2020
1 parent 15a1523 commit 493ebbe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions netconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ type netConn struct {
var _ net.Conn = &netConn{}

func (nc *netConn) Close() error {
nc.writeTimer.Stop()
nc.readTimer.Stop()
return nc.c.Close(StatusNormalClosure, "")
}

Expand Down

0 comments on commit 493ebbe

Please sign in to comment.