From 309b64e3764be93865414c6c6c87046c221b8b35 Mon Sep 17 00:00:00 2001 From: v2ray Date: Sat, 4 Jun 2016 19:59:58 +0200 Subject: [PATCH] take ich2Recycle as a parameter --- shell/point/inbound_detour_dynamic.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/shell/point/inbound_detour_dynamic.go b/shell/point/inbound_detour_dynamic.go index e32500c50..13c846e30 100644 --- a/shell/point/inbound_detour_dynamic.go +++ b/shell/point/inbound_detour_dynamic.go @@ -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 }