take ich2Recycle as a parameter

pull/299/head^2
v2ray 2016-06-04 19:59:58 +02:00
parent ea8f7e7506
commit 309b64e376
1 changed files with 3 additions and 4 deletions

View File

@ -102,9 +102,9 @@ func (this *InboundDetourHandlerDynamic) refresh() error {
this.ichs = newIchs
this.Unlock()
go func() {
go func(recycles []proxy.InboundHandler) {
time.Sleep(time.Minute)
for _, ich := range ich2Recycle {
for _, ich := range recycles {
if ich == nil {
continue
}
@ -112,8 +112,7 @@ func (this *InboundDetourHandlerDynamic) refresh() error {
ich.Close()
delete(this.portsInUse, port)
}
ich2Recycle = nil
}()
}(ich2Recycle)
return nil
}