[Orxonox-commit 3980] r8654 - code/branches/presentation/src/orxonox/items

landauf at orxonox.net landauf at orxonox.net
Sun May 29 09:58:34 CEST 2011


Author: landauf
Date: 2011-05-29 09:58:34 +0200 (Sun, 29 May 2011)
New Revision: 8654

Modified:
   code/branches/presentation/src/orxonox/items/Engine.cc
Log:
fixed engine destructor

Modified: code/branches/presentation/src/orxonox/items/Engine.cc
===================================================================
--- code/branches/presentation/src/orxonox/items/Engine.cc	2011-05-28 20:40:10 UTC (rev 8653)
+++ code/branches/presentation/src/orxonox/items/Engine.cc	2011-05-29 07:58:34 UTC (rev 8654)
@@ -71,8 +71,11 @@
 
     Engine::~Engine()
     {
-        if( this->ship_ && this->ship_->hasEngine(this) )
-            this->ship_->removeEngine(this);
+        if (this->isInitialized())
+        {
+            if (this->ship_ && this->ship_->hasEngine(this))
+                this->ship_->removeEngine(this);
+        }
     }
 
     void Engine::XMLPort(Element& xmlelement, XMLPort::Mode mode)




More information about the Orxonox-commit mailing list