Fix wireguard events

This commit is contained in:
世界
2023-01-15 19:47:32 +08:00
parent 59e521c1db
commit 8e0fe55363
2 changed files with 1 additions and 8 deletions

View File

@@ -197,10 +197,9 @@ func (w *StackDevice) Events() chan tun.Event {
func (w *StackDevice) Close() error {
select {
case <-w.events:
case <-w.done:
return os.ErrClosed
default:
close(w.events)
}
w.stack.Close()
for _, endpoint := range w.stack.CleanupEndpoints() {