[Orxonox-commit 5868] r10528 - code/branches/core7/src/libraries/core/singleton

landauf at orxonox.net landauf at orxonox.net
Sat Jun 6 12:37:28 CEST 2015


Author: landauf
Date: 2015-06-06 12:37:27 +0200 (Sat, 06 Jun 2015)
New Revision: 10528

Modified:
   code/branches/core7/src/libraries/core/singleton/ScopedSingletonWrapper.h
Log:
destroy singleton when wrapper is destroyed

Modified: code/branches/core7/src/libraries/core/singleton/ScopedSingletonWrapper.h
===================================================================
--- code/branches/core7/src/libraries/core/singleton/ScopedSingletonWrapper.h	2015-06-06 08:43:12 UTC (rev 10527)
+++ code/branches/core7/src/libraries/core/singleton/ScopedSingletonWrapper.h	2015-06-06 10:37:27 UTC (rev 10528)
@@ -96,6 +96,8 @@
 
         ~ClassScopedSingletonWrapper()
         {
+            if (singletonPtr_)
+                this->destroy(singletonPtr_);
         }
 
         //! Called if the Scope of the Singleton gets active (creates the instance)
@@ -149,6 +151,8 @@
 
         ~ClassScopedSingletonWrapper()
         {
+            if (singletonPtr_)
+                this->destroy(singletonPtr_);
         }
 
         //! Called if the Scope of the Singleton gets active (creates the instance)




More information about the Orxonox-commit mailing list