From 7d27d144a521bde96e6b651fe5cf5f2f6b6aa603 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Sat, 10 Mar 2018 19:35:20 +0300 Subject: [PATCH] Possible fix for https://bugs.vcmi.eu/view.php?id=2913 --- lib/spells/effects/Registry.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/spells/effects/Registry.cpp b/lib/spells/effects/Registry.cpp index 304d336aa..9584f93a8 100644 --- a/lib/spells/effects/Registry.cpp +++ b/lib/spells/effects/Registry.cpp @@ -16,8 +16,6 @@ namespace spells namespace effects { -std::unique_ptr Instance; - namespace detail { class RegistryImpl : public Registry @@ -53,8 +51,7 @@ Registry::~Registry() = default; Registry * Registry::get() { - if(!Instance) - Instance = make_unique(); + static std::unique_ptr Instance = make_unique(); return Instance.get(); }