diff --git a/device/device.go b/device/device.go index c64432e..c440679 100644 --- a/device/device.go +++ b/device/device.go @@ -383,10 +383,10 @@ func (device *Device) Close() { device.isUp.Set(false) close(device.signals.stop) + device.state.stopping.Wait() device.RemoveAllPeers() - device.state.stopping.Wait() device.FlushPacketQueues() device.rate.limiter.Close()