mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
close inner features before resetting
This commit is contained in:
parent
f0849543ed
commit
c335789e40
2
dns.go
2
dns.go
@ -52,6 +52,8 @@ func (d *syncDNSClient) Set(client DNSClient) {
|
||||
return
|
||||
}
|
||||
|
||||
d.Close()
|
||||
|
||||
d.Lock()
|
||||
defer d.Unlock()
|
||||
|
||||
|
11
network.go
11
network.go
@ -84,6 +84,12 @@ func (m *syncInboundHandlerManager) Close() error {
|
||||
}
|
||||
|
||||
func (m *syncInboundHandlerManager) Set(manager InboundHandlerManager) {
|
||||
if manager == nil {
|
||||
return
|
||||
}
|
||||
|
||||
m.Close()
|
||||
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
@ -161,6 +167,11 @@ func (m *syncOutboundHandlerManager) Close() error {
|
||||
}
|
||||
|
||||
func (m *syncOutboundHandlerManager) Set(manager OutboundHandlerManager) {
|
||||
if manager == nil {
|
||||
return
|
||||
}
|
||||
|
||||
m.Close()
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
|
@ -87,6 +87,8 @@ func (m *syncPolicyManager) Set(manager PolicyManager) {
|
||||
return
|
||||
}
|
||||
|
||||
m.Close()
|
||||
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
|
10
router.go
10
router.go
@ -54,6 +54,11 @@ func (d *syncDispatcher) Close() error {
|
||||
}
|
||||
|
||||
func (d *syncDispatcher) Set(disp Dispatcher) {
|
||||
if disp == nil {
|
||||
return
|
||||
}
|
||||
|
||||
d.Close()
|
||||
d.Lock()
|
||||
defer d.Unlock()
|
||||
|
||||
@ -108,6 +113,11 @@ func (r *syncRouter) Close() error {
|
||||
}
|
||||
|
||||
func (r *syncRouter) Set(router Router) {
|
||||
if router == nil {
|
||||
return
|
||||
}
|
||||
|
||||
r.Close()
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user