summaryrefslogtreecommitdiffhomepage
path: root/device.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-24 01:52:02 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-24 01:52:02 +0200
commitebc7541953269b39cd73d703166b9b8ee7b34e37 (patch)
tree9f436df296e7fba4a29b4a084d637c304844b7de /device.go
parent833597b585f460aaa17bad93ad59290ec282e77e (diff)
Fix shutdown races
Diffstat (limited to 'device.go')
-rw-r--r--device.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/device.go b/device.go
index 7cf9ba2..8823404 100644
--- a/device.go
+++ b/device.go
@@ -377,10 +377,11 @@ func (device *Device) Close() {
close(device.signals.stop)
+ device.RemoveAllPeers()
+
device.state.stopping.Wait()
device.FlushPacketQueues()
- device.RemoveAllPeers()
device.rate.limiter.Close()
device.state.changing.Set(false)