mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
单例对象销毁时的检查,修正由此错误的销毁单例对象的bug
This commit is contained in:
@@ -35,9 +35,12 @@ namespace GameBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnDestroy()
|
protected virtual void OnDestroy()
|
||||||
|
{
|
||||||
|
if (this == _instance)
|
||||||
{
|
{
|
||||||
Release();
|
Release();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 判断对象是否有效
|
/// 判断对象是否有效
|
||||||
|
Reference in New Issue
Block a user