From 507c7ba12ce1bec31d6f3236dd4081c187072baa Mon Sep 17 00:00:00 2001 From: Anton Tarasenko Date: Sat, 18 Jul 2020 02:37:20 +0700 Subject: [PATCH] Fix `Singleton` not calling `OnDestroyed()` event --- sources/Core/Singleton.uc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/Core/Singleton.uc b/sources/Core/Singleton.uc index c4d61c4..bd83fa7 100644 --- a/sources/Core/Singleton.uc +++ b/sources/Core/Singleton.uc @@ -91,9 +91,10 @@ event PreBeginPlay() event Destroyed() { super.Destroyed(); - if (self == GetInstance()) + if (self == default.activeInstance) { OnDestroyed(); + default.activeInstance = none; } }