Skip to content

Commit

Permalink
npiperelay: Close event handles when file is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarks committed Sep 14, 2017
1 parent 5321ddc commit 003b169
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion overlappedfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,18 @@ func (f *overlappedFile) Write(b []byte) (int, error) {
}

func (f *overlappedFile) Close() error {
windows.Close(f.h)
err := windows.Close(f.h)
if err != nil {
panic(err)
}
f.h = 0
for _, h := range f.e {
err := windows.Close(h)
if err != nil {
panic(err)
}
}
f.e = nil
return nil
}

Expand Down

0 comments on commit 003b169

Please sign in to comment.