summaryrefslogtreecommitdiffhomepage
path: root/tun_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'tun_windows.go')
-rw-r--r--tun_windows.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/tun_windows.go b/tun_windows.go
index c0c9ff8..6eea5a3 100644
--- a/tun_windows.go
+++ b/tun_windows.go
@@ -125,7 +125,9 @@ func (f *NativeTUN) Events() chan TUNEvent {
}
func (f *NativeTUN) Close() error {
- return windows.Close(f.fd)
+ close(f.events)
+ err := windows.Close(f.fd)
+ return err
}
func (f *NativeTUN) Write(b []byte) (int, error) {