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>
|
/// </summary>
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
if (_handle != null)
|
if (_handle is { IsValid: true })
|
||||||
{
|
{
|
||||||
_handle.Dispose();
|
_handle.Dispose();
|
||||||
}
|
}
|
||||||
|
@@ -59,7 +59,7 @@ namespace TEngine
|
|||||||
public void Bind(AssetOperationHandle operation, string assetLocation, AssetReference parent = null,
|
public void Bind(AssetOperationHandle operation, string assetLocation, AssetReference parent = null,
|
||||||
string packageName = "")
|
string packageName = "")
|
||||||
{
|
{
|
||||||
if (_operationHandle != null)
|
if (_operationHandle is { IsValid: true })
|
||||||
{
|
{
|
||||||
Log.Warning($"rebind AssetReference gameObject.name:{gameObject.name} assetLocation:{assetLocation}");
|
Log.Warning($"rebind AssetReference gameObject.name:{gameObject.name} assetLocation:{assetLocation}");
|
||||||
_operationHandle.Dispose();
|
_operationHandle.Dispose();
|
||||||
|
Reference in New Issue
Block a user