transport/wg: m netstack Destory shorthand for Close+Wait

Signed-off-by: ignoramous <ignoramous@users.noreply.github.com>
This commit is contained in:
ignoramous 2023-09-29 11:37:13 +05:30 committed by GitHub
parent 8f2ef67e62
commit 0c4c5cff6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -235,11 +235,7 @@ func (w *StackDevice) Close() error {
return os.ErrClosed
default:
}
w.stack.Close()
for _, endpoint := range w.stack.CleanupEndpoints() {
endpoint.Abort()
}
w.stack.Wait()
w.stack.Destroy()
close(w.done)
return nil
}