mirror of
https://github.com/xjasonlyu/tun2socks.git
synced 2024-12-30 02:37:01 +00:00
Fix: wait for device to close
This commit is contained in:
+8
-5
@@ -80,13 +80,16 @@ func (e *engine) start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (e *engine) stop() error {
|
||||
func (e *engine) stop() (err error) {
|
||||
if e.device != nil {
|
||||
return e.device.Close()
|
||||
err = e.device.Close()
|
||||
e.device.Wait()
|
||||
}
|
||||
e.stack.Close()
|
||||
e.stack.Wait()
|
||||
return nil
|
||||
if e.stack != nil {
|
||||
e.stack.Close()
|
||||
e.stack.Wait()
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (e *engine) insert(k *Key) {
|
||||
|
||||
Reference in New Issue
Block a user