From b21f3137a4e320f84a2d31e1e44c923d02327beb Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 19 Mar 2010 16:28:32 -0700 Subject: [PATCH] os: drop File finalizer after normal Close R=r CC=golang-dev https://golang.org/cl/586043 --- src/pkg/os/file.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pkg/os/file.go b/src/pkg/os/file.go index 83b022aa0ae..75c0561e9ec 100644 --- a/src/pkg/os/file.go +++ b/src/pkg/os/file.go @@ -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 }