From cfaf82a6232b569c0a3f46f57c991088983695bb Mon Sep 17 00:00:00 2001 From: ALEXTANG <574809918@qq.com> Date: Thu, 26 Oct 2023 14:07:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8A=E6=94=BE=E8=B5=84=E6=BA=90=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E8=B5=84=E6=BA=90=E6=98=AF=E5=90=A6=E6=9C=89=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 释放资源判断资源是否有效 --- .../Runtime/Modules/ResourceModule/ResourceManager.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/UnityProject/Assets/TEngine/Runtime/Modules/ResourceModule/ResourceManager.cs b/UnityProject/Assets/TEngine/Runtime/Modules/ResourceModule/ResourceManager.cs index f768c5d3..45a28b50 100644 --- a/UnityProject/Assets/TEngine/Runtime/Modules/ResourceModule/ResourceManager.cs +++ b/UnityProject/Assets/TEngine/Runtime/Modules/ResourceModule/ResourceManager.cs @@ -101,7 +101,6 @@ namespace TEngine internal override void Shutdown() { - ReleaseAllHandle(); #if !UNITY_WEBGL YooAssets.Destroy(); #endif @@ -114,13 +113,12 @@ namespace TEngine while (iter.MoveNext()) { AssetOperationHandle handle = iter.Current; - if (handle != null) + if (handle is { IsValid: true }) { handle.Dispose(); handle = null; } } - iter.Dispose(); _releaseMaps.Clear(); @@ -128,15 +126,15 @@ namespace TEngine while (iter.MoveNext()) { AssetOperationHandle handle = iter.Current; - if (handle != null) + if (handle is { IsValid: true }) { handle.Dispose(); handle = null; } } - iter.Dispose(); _operationHandlesMaps.Clear(); + _arcCacheTable = new ArcCacheTable(ARCTableCapacity, OnAddAsset, OnRemoveAsset); }