Browse Source

Fix `Singleton` not calling `OnDestroyed()` event

new
Anton Tarasenko 4 years ago
parent
commit
507c7ba12c
  1. 3
      sources/Core/Singleton.uc

3
sources/Core/Singleton.uc

@ -91,9 +91,10 @@ event PreBeginPlay()
event Destroyed() event Destroyed()
{ {
super.Destroyed(); super.Destroyed();
if (self == GetInstance()) if (self == default.activeInstance)
{ {
OnDestroyed(); OnDestroyed();
default.activeInstance = none;
} }
} }