[Orxonox-commit 1079] r5800 - in code/branches/core5/src/modules: objects/eventsystem overlays/hud overlays/stats pong questsystem questsystem/notifications weapons/projectiles

landauf at orxonox.net landauf at orxonox.net
Sat Sep 26 22:21:26 CEST 2009


Author: landauf
Date: 2009-09-26 22:21:26 +0200 (Sat, 26 Sep 2009)
New Revision: 5800

Modified:
   code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.cc
   code/branches/core5/src/modules/overlays/hud/HUDHealthBar.cc
   code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc
   code/branches/core5/src/modules/overlays/stats/CreateLines.cc
   code/branches/core5/src/modules/pong/Pong.cc
   code/branches/core5/src/modules/pong/PongAI.cc
   code/branches/core5/src/modules/questsystem/QuestGUI.cc
   code/branches/core5/src/modules/questsystem/QuestManager.cc
   code/branches/core5/src/modules/questsystem/notifications/NotificationQueue.cc
   code/branches/core5/src/modules/weapons/projectiles/ParticleProjectile.cc
   code/branches/core5/src/modules/weapons/projectiles/Projectile.cc
Log:
replaced delete with destroy() in modules

Modified: code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.cc
===================================================================
--- code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/objects/eventsystem/EventDispatcher.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -46,7 +46,7 @@
     {
         if (this->isInitialized())
             for (std::list<EventTarget*>::iterator it = this->targets_.begin(); it != this->targets_.end(); ++it)
-                delete (*it);
+                (*it)->destroy();
     }
 
     void EventDispatcher::XMLPort(Element& xmlelement, XMLPort::Mode mode)

Modified: code/branches/core5/src/modules/overlays/hud/HUDHealthBar.cc
===================================================================
--- code/branches/core5/src/modules/overlays/hud/HUDHealthBar.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/overlays/hud/HUDHealthBar.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -55,7 +55,7 @@
     HUDHealthBar::~HUDHealthBar()
     {
         if (this->isInitialized())
-            delete this->textoverlay_;
+            this->textoverlay_->destroy();
     }
 
     void HUDHealthBar::XMLPort(Element& xmlelement, XMLPort::Mode mode)

Modified: code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc
===================================================================
--- code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/overlays/hud/UnderAttackHealthBar.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -57,7 +57,7 @@
     UnderAttackHealthBar::~UnderAttackHealthBar()
     {
         if (this->isInitialized())
-            delete this->text_;
+            this->text_->destroy();
     }
 
     void UnderAttackHealthBar::XMLPort(Element& xmlelement, XMLPort::Mode mode)

Modified: code/branches/core5/src/modules/overlays/stats/CreateLines.cc
===================================================================
--- code/branches/core5/src/modules/overlays/stats/CreateLines.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/overlays/stats/CreateLines.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -58,10 +58,10 @@
 
     CreateLines::~CreateLines()
     {
-        delete this->playerNameText_;
-        delete this->scoreText_;
-        delete this->deathsText_;
-        delete this->background_;
+        this->playerNameText_->destroy();
+        this->scoreText_->destroy();
+        this->deathsText_->destroy();
+        this->background_->destroy();
     }
 
     void CreateLines::setPlayerName(const std::string& str)

Modified: code/branches/core5/src/modules/pong/Pong.cc
===================================================================
--- code/branches/core5/src/modules/pong/Pong.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/pong/Pong.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -119,7 +119,7 @@
     {
         if (this->ball_)
         {
-            delete this->ball_;
+            this->ball_->destroy();
             this->ball_ = 0;
         }
 

Modified: code/branches/core5/src/modules/pong/PongAI.cc
===================================================================
--- code/branches/core5/src/modules/pong/PongAI.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/pong/PongAI.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -60,7 +60,7 @@
     PongAI::~PongAI()
     {
         for (std::list<std::pair<Timer<PongAI>*, char> >::iterator it = this->reactionTimers_.begin(); it != this->reactionTimers_.end(); ++it)
-            delete (*it).first;
+            (*it).first->destroy();
     }
 
     void PongAI::setConfigValues()
@@ -246,7 +246,7 @@
 
         // Destroy the timer and remove it from the list
         Timer<PongAI>* timer = this->reactionTimers_.front().first;
-        delete timer;
+        timer->destroy();
 
         this->reactionTimers_.pop_front();
     }

Modified: code/branches/core5/src/modules/questsystem/QuestGUI.cc
===================================================================
--- code/branches/core5/src/modules/questsystem/QuestGUI.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/questsystem/QuestGUI.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -78,7 +78,7 @@
         this->windows_.clear();
         
         if(this->root_ != NULL)
-            delete this->root_;
+            this->root_->destroy();
     }
 
     /**
@@ -145,7 +145,7 @@
             node->getName(*str);
             COUT(3) << "Clearing Node '" << *str << "' ..." << std::endl;
             delete str;
-            delete node;
+            node->destroy();
         }
         this->nodes_.clear();
 

Modified: code/branches/core5/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/branches/core5/src/modules/questsystem/QuestManager.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/questsystem/QuestManager.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -75,7 +75,7 @@
     {
         for(std::map<PlayerInfo*, QuestGUI*>::iterator it = this->questGUIs_.begin(); it != this->questGUIs_.end(); it++)
         {
-            delete (*it).second;
+            (*it).second->destroy();
         }
         this->questGUIs_.clear();
     }

Modified: code/branches/core5/src/modules/questsystem/notifications/NotificationQueue.cc
===================================================================
--- code/branches/core5/src/modules/questsystem/notifications/NotificationQueue.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/questsystem/notifications/NotificationQueue.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -425,7 +425,7 @@
         this->removeElement(container->overlay);
         this->containers_.erase(container);
         this->overlays_.erase(container->notification);
-        delete container->overlay;
+        container->overlay->destroy();
         delete container;
         this->size_= this->size_-1;
 

Modified: code/branches/core5/src/modules/weapons/projectiles/ParticleProjectile.cc
===================================================================
--- code/branches/core5/src/modules/weapons/projectiles/ParticleProjectile.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/weapons/projectiles/ParticleProjectile.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -58,7 +58,7 @@
         if (this->isInitialized() && this->particles_)
         {
             this->detachOgreObject(this->particles_->getParticleSystem());
-            delete this->particles_;
+            this->particles_->destroy();
         }
     }
 

Modified: code/branches/core5/src/modules/weapons/projectiles/Projectile.cc
===================================================================
--- code/branches/core5/src/modules/weapons/projectiles/Projectile.cc	2009-09-26 20:19:14 UTC (rev 5799)
+++ code/branches/core5/src/modules/weapons/projectiles/Projectile.cc	2009-09-26 20:21:26 UTC (rev 5800)
@@ -83,13 +83,13 @@
             return;
 
         if (this->bDestroy_)
-            delete this;
+            this->destroy(); // TODO: use a scheduler instead of deleting the object right here in tick()
     }
 
     void Projectile::destroyObject()
     {
         if (GameMode::isMaster())
-            delete this;
+            this->destroy();
     }
 
     bool Projectile::collidesAgainst(WorldEntity* otherObject, btManifoldPoint& contactPoint)




More information about the Orxonox-commit mailing list