1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:14:47 -07:00

os: drop File finalizer after normal Close

R=r
CC=golang-dev
https://golang.org/cl/586043
This commit is contained in:
Russ Cox 2010-03-19 16:28:32 -07:00
parent f4322a848d
commit b21f3137a4

View File

@ -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
}