1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-21 17:46:58 -05:00

fix setter methods

This commit is contained in:
Darien Raymond 2018-02-20 22:07:58 +01:00
parent 3734195156
commit 955444adc9
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169
4 changed files with 6 additions and 9 deletions

3
dns.go
View File

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

View File

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

View File

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

View File

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