summaryrefslogtreecommitdiff
path: root/indra/llcommon/llsingleton.h
diff options
context:
space:
mode:
authorDave Houlton <euclid@lindenlab.com>2021-11-15 09:25:35 -0700
committerDave Houlton <euclid@lindenlab.com>2021-11-15 09:25:35 -0700
commit029b41c0419e975bbb28454538b46dc69ce5d2ba (patch)
tree4f9a28bb36ee07fe9a7b45a434384afd1f24bb85 /indra/llcommon/llsingleton.h
parentaeed774ff9cc55c0c1dd2784e23b2366ff367fbe (diff)
Revert "SL-16220: Merge branch 'origin/DRTVWR-546' into glthread"
This reverts commit 5188a26a8521251dda07ac0140bb129f28417e49, reversing changes made to 819088563e13f1d75e048311fbaf0df4a79b7e19.
Diffstat (limited to 'indra/llcommon/llsingleton.h')
-rw-r--r--indra/llcommon/llsingleton.h24
1 files changed, 9 insertions, 15 deletions
diff --git a/indra/llcommon/llsingleton.h b/indra/llcommon/llsingleton.h
index 6042c0906c..10a8ecfedb 100644
--- a/indra/llcommon/llsingleton.h
+++ b/indra/llcommon/llsingleton.h
@@ -847,28 +847,22 @@ template<class T>
class LLSimpleton
{
public:
- template <typename... ARGS>
- static void createInstance(ARGS&&... args)
- {
+ static T* sInstance;
+
+ static void createInstance()
+ {
llassert(sInstance == nullptr);
- sInstance = new T(std::forward<ARGS>(args)...);
+ sInstance = new T();
}
-
+
static inline T* getInstance() { return sInstance; }
static inline T& instance() { return *getInstance(); }
static inline bool instanceExists() { return sInstance != nullptr; }
- static void deleteSingleton()
- {
- delete sInstance;
- sInstance = nullptr;
+ static void deleteSingleton() {
+ delete sInstance;
+ sInstance = nullptr;
}
-
-private:
- static T* sInstance;
};
-template <class T>
-T* LLSimpleton<T>::sInstance{ nullptr };
-
#endif