diff options
Diffstat (limited to 'src/google/protobuf/stubs/singleton.h')
-rw-r--r-- | src/google/protobuf/stubs/singleton.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/google/protobuf/stubs/singleton.h b/src/google/protobuf/stubs/singleton.h index e123e4fe..9301f549 100644 --- a/src/google/protobuf/stubs/singleton.h +++ b/src/google/protobuf/stubs/singleton.h @@ -44,6 +44,10 @@ class Singleton { GoogleOnceInit(&once_, &Singleton<T>::Init); return instance_; } + static void ShutDown() { + delete instance_; + instance_ = NULL; + } private: static void Init() { instance_ = new T(); @@ -56,7 +60,7 @@ template<typename T> ProtobufOnceType Singleton<T>::once_; template<typename T> -T* Singleton<T>::instance_; +T* Singleton<T>::instance_ = NULL; } // namespace internal } // namespace protobuf } // namespace google |