mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 01:57:12 -05:00
fix setter methods
This commit is contained in:
parent
3734195156
commit
955444adc9
3
dns.go
3
dns.go
@ -52,10 +52,9 @@ func (d *syncDNSClient) Set(client DNSClient) {
|
||||
return
|
||||
}
|
||||
|
||||
d.Close()
|
||||
|
||||
d.Lock()
|
||||
defer d.Unlock()
|
||||
|
||||
common.Close(d.DNSClient)
|
||||
d.DNSClient = client
|
||||
}
|
||||
|
@ -88,11 +88,10 @@ func (m *syncInboundHandlerManager) Set(manager InboundHandlerManager) {
|
||||
return
|
||||
}
|
||||
|
||||
m.Close()
|
||||
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
common.Close(m.InboundHandlerManager)
|
||||
m.InboundHandlerManager = manager
|
||||
}
|
||||
|
||||
@ -171,9 +170,9 @@ func (m *syncOutboundHandlerManager) Set(manager OutboundHandlerManager) {
|
||||
return
|
||||
}
|
||||
|
||||
m.Close()
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
common.Close(m.OutboundHandlerManager)
|
||||
m.OutboundHandlerManager = manager
|
||||
}
|
||||
|
@ -87,10 +87,9 @@ func (m *syncPolicyManager) Set(manager PolicyManager) {
|
||||
return
|
||||
}
|
||||
|
||||
m.Close()
|
||||
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
common.Close(m.PolicyManager)
|
||||
m.PolicyManager = manager
|
||||
}
|
||||
|
@ -58,10 +58,10 @@ func (d *syncDispatcher) Set(disp Dispatcher) {
|
||||
return
|
||||
}
|
||||
|
||||
d.Close()
|
||||
d.Lock()
|
||||
defer d.Unlock()
|
||||
|
||||
common.Close(d.Dispatcher)
|
||||
d.Dispatcher = disp
|
||||
}
|
||||
|
||||
@ -117,9 +117,9 @@ func (r *syncRouter) Set(router Router) {
|
||||
return
|
||||
}
|
||||
|
||||
r.Close()
|
||||
r.Lock()
|
||||
defer r.Unlock()
|
||||
|
||||
common.Close(r.Router)
|
||||
r.Router = router
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user