mirror of
https://github.com/golang/go
synced 2024-11-25 07:57:56 -07:00
os: drop File finalizer after normal Close
R=r CC=golang-dev https://golang.org/cl/586043
This commit is contained in:
parent
f4322a848d
commit
b21f3137a4
@ -97,6 +97,9 @@ func (file *File) Close() Error {
|
||||
err = &PathError{"close", file.name, Errno(e)}
|
||||
}
|
||||
file.fd = -1 // so it can't be closed again
|
||||
|
||||
// no need for a finalizer anymore
|
||||
runtime.SetFinalizer(file, nil)
|
||||
return err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user