[Orxonox-commit 1135] r5856 - code/branches/core5/src/modules/overlays/hud

rgrieder at orxonox.net rgrieder at orxonox.net
Fri Oct 2 10:30:57 CEST 2009


Author: rgrieder
Date: 2009-10-02 10:30:56 +0200 (Fri, 02 Oct 2009)
New Revision: 5856

Modified:
   code/branches/core5/src/modules/overlays/hud/HUDBar.cc
Log:
Convinced HUDBar to destroy its BarColours (as they grow with each player death otherwise).

Modified: code/branches/core5/src/modules/overlays/hud/HUDBar.cc
===================================================================
--- code/branches/core5/src/modules/overlays/hud/HUDBar.cc	2009-10-02 06:36:25 UTC (rev 5855)
+++ code/branches/core5/src/modules/overlays/hud/HUDBar.cc	2009-10-02 08:30:56 UTC (rev 5856)
@@ -95,7 +95,11 @@
     HUDBar::~HUDBar()
     {
         if (this->isInitialized())
+        {
             Ogre::OverlayManager::getSingleton().destroyOverlayElement(this->bar_);
+            for (std::vector<BarColour*>::const_iterator it = this->barColours_.begin(); it != this->barColours_.end(); )
+                (*it++)->destroy();
+        }
     }
 
     void HUDBar::XMLPort(Element& xmlElement, XMLPort::Mode mode)




More information about the Orxonox-commit mailing list