You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc comment for win32File indicates the file will be closed when the Go object is garbage collected.
// win32File implements Reader, Writer, and Closer on a Win32 handle without blocking in a syscall.// It takes ownership of this handle and will close it if it is garbage collected.typewin32Filestruct {
handle windows.Handlewg sync.WaitGroupwgLock sync.RWMutexclosingatomicBoolsocketboolreadDeadlinedeadlineHandlerwriteDeadlinedeadlineHandler
}
However, grepping through the codebase I cannot find a single call to runtime.SetFinalizer. I'm curious: if this doc comment is true, how is the file being closed on garbage collection without any such calls to runtime.SetFinalizer?
I'm writing some logic that serves net.Conn (provided by this package), and I want to know if I need to take care of setting a finalizer myself or not.
Thanks!
The text was updated successfully, but these errors were encountered:
The doc comment for
win32File
indicates the file will be closed when the Go object is garbage collected.However, grepping through the codebase I cannot find a single call to
runtime.SetFinalizer
. I'm curious: if this doc comment is true, how is the file being closed on garbage collection without any such calls toruntime.SetFinalizer
?I'm writing some logic that serves
net.Conn
(provided by this package), and I want to know if I need to take care of setting a finalizer myself or not.Thanks!
The text was updated successfully, but these errors were encountered: