]> granicus.if.org Git - icinga2/commitdiff
Windows build fix.
authorGunnar Beutner <gunnar.beutner@netways.de>
Fri, 15 Mar 2013 12:39:53 +0000 (13:39 +0100)
committerGunnar Beutner <gunnar.beutner@netways.de>
Fri, 15 Mar 2013 12:39:53 +0000 (13:39 +0100)
lib/base/singleton.h

index 4f65da04a00145232ddea57e77624bc6164fe026..573daabca5efd9a067e1704604a4e4dc449acf6a 100644 (file)
@@ -38,20 +38,17 @@ public:
                static boost::mutex mutex;
                boost::mutex::scoped_lock lock(mutex);
 
-               if (!m_Instance)
-                       m_Instance = new T();
+               static T *instance = NULL;
 
-               return m_Instance;
+               if (!instance)
+                       instance = new T();
+
+               return instance;
        }
 private:
        friend T *T::GetInstance(void);
-
-       static T *m_Instance;
 };
 
-template<typename T>
-T *Singleton<T>::m_Instance = NULL;
-
 }
 
 #endif /* SINGLETON_H */