Explorar o código

修复ETTask对象池一个bug

tanghai %!s(int64=3) %!d(string=hai) anos
pai
achega
576500356c
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      Unity/Assets/Scripts/ThirdParty/ETTask/ETTask.cs

+ 3 - 3
Unity/Assets/Scripts/ThirdParty/ETTask/ETTask.cs

@@ -195,12 +195,12 @@ namespace ET
             this.callback = null;
             this.value = default;
             this.state = AwaiterStatus.Pending;
-            queue.Enqueue(this);
-            // 太多了,回收一下
+            // 太多了
             if (queue.Count > 1000)
             {
-                queue.Clear();
+                return;
             }
+            queue.Enqueue(this);
         }
 
         private bool fromPool;