From 3dff7e6b2e11f4c02251fb94848f0bb313f1d67d Mon Sep 17 00:00:00 2001 From: je Date: Mon, 8 Jul 2024 12:48:19 +0800 Subject: [PATCH] fix: Instance caused a stack overflow --- Assets/Scripts/Runtime/Singleton.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/Runtime/Singleton.cs b/Assets/Scripts/Runtime/Singleton.cs index 981a830..b06be06 100644 --- a/Assets/Scripts/Runtime/Singleton.cs +++ b/Assets/Scripts/Runtime/Singleton.cs @@ -44,12 +44,12 @@ public static T Instance { get { - if (Instance == null) + if (instance == null) { //ensure that only one thread can execute lock (typeof(T)) { - if (Instance == null) + if (instance == null) { instance = new T(); instance.InitializeSingleton();