mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
释放资源判断资源是否有效
释放资源判断资源是否有效
This commit is contained in:
@@ -101,7 +101,6 @@ namespace TEngine
|
|||||||
|
|
||||||
internal override void Shutdown()
|
internal override void Shutdown()
|
||||||
{
|
{
|
||||||
ReleaseAllHandle();
|
|
||||||
#if !UNITY_WEBGL
|
#if !UNITY_WEBGL
|
||||||
YooAssets.Destroy();
|
YooAssets.Destroy();
|
||||||
#endif
|
#endif
|
||||||
@@ -114,13 +113,12 @@ namespace TEngine
|
|||||||
while (iter.MoveNext())
|
while (iter.MoveNext())
|
||||||
{
|
{
|
||||||
AssetOperationHandle handle = iter.Current;
|
AssetOperationHandle handle = iter.Current;
|
||||||
if (handle != null)
|
if (handle is { IsValid: true })
|
||||||
{
|
{
|
||||||
handle.Dispose();
|
handle.Dispose();
|
||||||
handle = null;
|
handle = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
iter.Dispose();
|
iter.Dispose();
|
||||||
_releaseMaps.Clear();
|
_releaseMaps.Clear();
|
||||||
|
|
||||||
@@ -128,15 +126,15 @@ namespace TEngine
|
|||||||
while (iter.MoveNext())
|
while (iter.MoveNext())
|
||||||
{
|
{
|
||||||
AssetOperationHandle handle = iter.Current;
|
AssetOperationHandle handle = iter.Current;
|
||||||
if (handle != null)
|
if (handle is { IsValid: true })
|
||||||
{
|
{
|
||||||
handle.Dispose();
|
handle.Dispose();
|
||||||
handle = null;
|
handle = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
iter.Dispose();
|
iter.Dispose();
|
||||||
_operationHandlesMaps.Clear();
|
_operationHandlesMaps.Clear();
|
||||||
|
|
||||||
_arcCacheTable = new ArcCacheTable<string, AssetOperationHandle>(ARCTableCapacity, OnAddAsset, OnRemoveAsset);
|
_arcCacheTable = new ArcCacheTable<string, AssetOperationHandle>(ARCTableCapacity, OnAddAsset, OnRemoveAsset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user