Skip to content

Commit

Permalink
Merge pull request #103 from erikdubbelboer/doubleclose
Browse files Browse the repository at this point in the history
Prevent bugs caused by multiple Close calls
  • Loading branch information
gobwas committed Feb 19, 2017
2 parents 7a67b2a + e187266 commit d89c33c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions buffer/pool.go
Expand Up @@ -252,6 +252,8 @@ func (r *readCloser) Close() error {
for _, buf := range r.bufs {
putBuf(buf)
}
// In case Close gets called multiple times.
r.bufs = nil

return nil
}
Expand Down

0 comments on commit d89c33c

Please sign in to comment.