diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/singleton.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/common/singleton.h b/common/singleton.h index 849bf208bb..be9f5d6dba 100644 --- a/common/singleton.h +++ b/common/singleton.h @@ -57,6 +57,11 @@ public: return new T(); } + static void destroyInstance() { + delete _singleton; + _singleton = 0; + } + public: static T& instance() { @@ -71,9 +76,9 @@ public: _singleton = T::makeInstance(); return *_singleton; } - virtual void destroy() { - delete _singleton; - _singleton = 0; + + static void destroy() { + T::destroyInstance(); } protected: Singleton<T>() { } |
