Browse Source

close inner features before resetting

pull/876/head
Darien Raymond 7 years ago
parent
commit
c335789e40
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
  1. 2
      dns.go
  2. 11
      network.go
  3. 2
      policy.go
  4. 10
      router.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

@ -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()

2
policy.go

@ -87,6 +87,8 @@ func (m *syncPolicyManager) Set(manager PolicyManager) {
return
}
m.Close()
m.Lock()
defer m.Unlock()

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…
Cancel
Save