mirror of
https://github.com/SagerNet/sing-tun.git
synced 2025-04-03 03:47:39 +03:00
Fix early close
This commit is contained in:
parent
d5efb43122
commit
b2bb9b3d2a
2 changed files with 12 additions and 5 deletions
|
@ -45,10 +45,15 @@ func (m *networkUpdateMonitor) Start() error {
|
|||
}
|
||||
|
||||
func (m *networkUpdateMonitor) Close() error {
|
||||
return E.Errors(
|
||||
m.routeListener.Unregister(),
|
||||
m.interfaceListener.Unregister(),
|
||||
)
|
||||
if m.routeListener != nil {
|
||||
m.routeListener.Unregister()
|
||||
m.routeListener = nil
|
||||
}
|
||||
if m.interfaceListener != nil {
|
||||
m.interfaceListener.Unregister()
|
||||
m.interfaceListener = nil
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *defaultInterfaceMonitor) checkUpdate() error {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue