Răsfoiți Sursa

Possible fix for https://bugs.vcmi.eu/view.php?id=2913

AlexVinS 7 ani în urmă
părinte
comite
7d27d144a5
1 a modificat fișierele cu 1 adăugiri și 4 ștergeri
  1. 1 4
      lib/spells/effects/Registry.cpp

+ 1 - 4
lib/spells/effects/Registry.cpp

@@ -16,8 +16,6 @@ namespace spells
 namespace effects
 {
 
-std::unique_ptr<Registry> Instance;
-
 namespace detail
 {
 class RegistryImpl : public Registry
@@ -53,8 +51,7 @@ Registry::~Registry() = default;
 
 Registry * Registry::get()
 {
-	if(!Instance)
-		Instance = make_unique<detail::RegistryImpl>();
+	static std::unique_ptr<Registry> Instance = make_unique<detail::RegistryImpl>();
 	return Instance.get();
 }