mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
Merge pull request #103 from erikdubbelboer/doubleclose
Prevent bugs caused by multiple Close calls
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user