From d1463e1fc614e046170e3b8c9153990216865614 Mon Sep 17 00:00:00 2001 From: gaozhou Date: Fri, 2 Dec 2022 14:23:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BAhandle=20=E6=B7=BB=E5=8A=A0=20using=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AssetSystem/Handles/OperationHandleBase.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Assets/YooAsset/Runtime/AssetSystem/Handles/OperationHandleBase.cs b/Assets/YooAsset/Runtime/AssetSystem/Handles/OperationHandleBase.cs index 18f241f..b08a44c 100644 --- a/Assets/YooAsset/Runtime/AssetSystem/Handles/OperationHandleBase.cs +++ b/Assets/YooAsset/Runtime/AssetSystem/Handles/OperationHandleBase.cs @@ -1,9 +1,22 @@ -using System.Collections; +using System; +using System.Collections; namespace YooAsset { - public abstract class OperationHandleBase : IEnumerator + public abstract class OperationHandleBase : IEnumerator, IDisposable { + private bool _isDisposed; + public void Dispose() + { + if (_isDisposed) + { + return; + } + + _isDisposed = true; + ReleaseInternal(); + } + private readonly AssetInfo _assetInfo; internal ProviderBase Provider { private set; get; }