[Orxonox-commit 6362] r11019 - code/trunk/src/libraries/core/object

landauf at orxonox.net landauf at orxonox.net
Sat Jan 2 21:08:12 CET 2016


Author: landauf
Date: 2016-01-02 21:08:12 +0100 (Sat, 02 Jan 2016)
New Revision: 11019

Modified:
   code/trunk/src/libraries/core/object/Destroyable.cc
Log:
(re-)added warning when a destroyable gets deleted without using destroy(). we had this warning in the code long time ago, but for some reason it was always commented out and at some point it got removed.

Modified: code/trunk/src/libraries/core/object/Destroyable.cc
===================================================================
--- code/trunk/src/libraries/core/object/Destroyable.cc	2016-01-02 19:59:12 UTC (rev 11018)
+++ code/trunk/src/libraries/core/object/Destroyable.cc	2016-01-02 20:08:12 UTC (rev 11019)
@@ -33,6 +33,7 @@
 
 #include "Destroyable.h"
 #include "DestroyLaterManager.h"
+#include "core/class/IdentifierManager.h"
 
 #include <cassert>
 
@@ -52,6 +53,9 @@
     */
     Destroyable::~Destroyable()
     {
+        if (!this->requestedDestruction_ && !IdentifierManager::getInstance().isCreatingHierarchy())
+            orxout(internal_warning) << "Deleted destroyable object without destroy()" << endl;
+
         assert(this->referenceCount_ <= 0);
 
         // notify all destruction listeners




More information about the Orxonox-commit mailing list