rwcancel: add an explicit close call
This lets us collect FDs even if the GC doesn't do it for us. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
a97ef39cd4
commit
6f08a10041
4 changed files with 8 additions and 0 deletions
|
|
@ -119,3 +119,8 @@ func (rw *RWCancel) Cancel() (err error) {
|
|||
_, err = rw.closingWriter.Write([]byte{0})
|
||||
return
|
||||
}
|
||||
|
||||
func (rw *RWCancel) Close() {
|
||||
rw.closingReader.Close()
|
||||
rw.closingWriter.Close()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue