Browse Source

fix setter methods

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

5
network.go

@ -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
}

3
policy.go

@ -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
}

4
router.go

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