mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
释放资源前判断资源合法性
This commit is contained in:
@@ -31,7 +31,7 @@ namespace TEngine
|
||||
/// </summary>
|
||||
public void Clear()
|
||||
{
|
||||
if (_handle != null)
|
||||
if (_handle is { IsValid: true })
|
||||
{
|
||||
_handle.Dispose();
|
||||
}
|
||||
|
@@ -59,7 +59,7 @@ namespace TEngine
|
||||
public void Bind(AssetOperationHandle operation, string assetLocation, AssetReference parent = null,
|
||||
string packageName = "")
|
||||
{
|
||||
if (_operationHandle != null)
|
||||
if (_operationHandle is { IsValid: true })
|
||||
{
|
||||
Log.Warning($"rebind AssetReference gameObject.name:{gameObject.name} assetLocation:{assetLocation}");
|
||||
_operationHandle.Dispose();
|
||||
|
Reference in New Issue
Block a user