فهرست منبع

take ich2Recycle as a parameter

v2ray 9 سال پیش
والد
کامیت
309b64e376
1فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 3 4
      shell/point/inbound_detour_dynamic.go

+ 3 - 4
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
 }