Skip to content

Commit 2c3f3f1

Browse files
authored
fix: MonoSingleton destory check improved.
1 parent 21564ed commit 2c3f3f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Runtime/Patterns/Singleton/MonoSingleton.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public static T Instance
2929
{
3030
get
3131
{
32-
if (s_ApplicationIsQuitting)
32+
if (s_ApplicationIsQuitting || s_IsDestroyed)
3333
{
3434
Debug.LogError(
3535
$"{typeof(T)} [MonoSingleton] is already destroyed. " +
@@ -94,4 +94,4 @@ protected virtual void OnApplicationQuit()
9494
s_ApplicationIsQuitting = true;
9595
}
9696
}
97-
}
97+
}

0 commit comments

Comments
 (0)