From 46c6953bdf16ef3cbf2b19fcb7b8b990ded2af2f Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Sat, 27 Aug 2016 08:22:25 +0200 Subject: [PATCH] added Poco::SingletonHolder::reset() --- Foundation/include/Poco/SingletonHolder.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Foundation/include/Poco/SingletonHolder.h b/Foundation/include/Poco/SingletonHolder.h index d3ddf0a22..4c91a8658 100644 --- a/Foundation/include/Poco/SingletonHolder.h +++ b/Foundation/include/Poco/SingletonHolder.h @@ -59,6 +59,14 @@ public: return _pS; } + void reset() + /// Deletes the singleton object. + { + FastMutex::ScopedLock lock(_m); + delete _pS; + _pS = 0; + } + private: S* _pS; FastMutex _m;