From 8d52535fade84bdf129af0574d910a598e8e3afd Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Fri, 15 Mar 2013 13:39:53 +0100 Subject: [PATCH] Windows build fix. --- lib/base/singleton.h | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/base/singleton.h b/lib/base/singleton.h index 4f65da04a..573daabca 100644 --- a/lib/base/singleton.h +++ b/lib/base/singleton.h @@ -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 -T *Singleton::m_Instance = NULL; - } #endif /* SINGLETON_H */ -- 2.49.0