[Orxonox-commit 3612] r8297 - in code/trunk/src: modules/designtools orxonox/interfaces

dafrick at orxonox.net dafrick at orxonox.net
Fri Apr 22 17:59:40 CEST 2011


Author: dafrick
Date: 2011-04-22 17:59:40 +0200 (Fri, 22 Apr 2011)
New Revision: 8297

Modified:
   code/trunk/src/modules/designtools/ScreenshotManager.cc
   code/trunk/src/modules/designtools/SkyboxGenerator.cc
   code/trunk/src/orxonox/interfaces/PickupCarrier.cc
Log:
Possible bug fix in PickupCarrier.


Modified: code/trunk/src/modules/designtools/ScreenshotManager.cc
===================================================================
--- code/trunk/src/modules/designtools/ScreenshotManager.cc	2011-04-22 06:48:08 UTC (rev 8296)
+++ code/trunk/src/modules/designtools/ScreenshotManager.cc	2011-04-22 15:59:40 UTC (rev 8297)
@@ -40,7 +40,6 @@
 #include <OgreRenderWindow.h>
 #include <OgreRoot.h>
 #include <OgreViewport.h>
-// #include <X11/Xlib.h> TODO: Needed?
 
 #include "core/ConfigValueIncludes.h"
 #include "core/GraphicsManager.h"
@@ -52,6 +51,8 @@
 #include "CameraManager.h"
 #include "graphics/Camera.h"
 
+// #include <X11/Xlib.h> TODO: Needed?
+
 namespace orxonox
 {
 

Modified: code/trunk/src/modules/designtools/SkyboxGenerator.cc
===================================================================
--- code/trunk/src/modules/designtools/SkyboxGenerator.cc	2011-04-22 06:48:08 UTC (rev 8296)
+++ code/trunk/src/modules/designtools/SkyboxGenerator.cc	2011-04-22 15:59:40 UTC (rev 8297)
@@ -36,7 +36,6 @@
 #include <string>
 #include <OgreRenderWindow.h>
 #include <OgreCamera.h>
-// #include <X11/Xlib.h> TODO: Needed?
 
 #include "util/ScopedSingletonManager.h"
 #include "core/CoreIncludes.h"
@@ -53,6 +52,8 @@
 
 #include "ScreenshotManager.h"
 
+// #include <X11/Xlib.h> TODO: Needed?
+
 namespace orxonox
 {
 

Modified: code/trunk/src/orxonox/interfaces/PickupCarrier.cc
===================================================================
--- code/trunk/src/orxonox/interfaces/PickupCarrier.cc	2011-04-22 06:48:08 UTC (rev 8296)
+++ code/trunk/src/orxonox/interfaces/PickupCarrier.cc	2011-04-22 15:59:40 UTC (rev 8297)
@@ -65,15 +65,16 @@
     void PickupCarrier::preDestroy(void)
     {
         std::set<Pickupable*>::iterator it = this->pickups_.begin();
-        std::set<Pickupable*>::iterator temp;
+        Pickupable* temp;
+        // Iterate over all pickups that are attached to this PickupCarrier and destroy them.
         while(it != this->pickups_.end())
         {
+            temp = *it;
             (*it)->carrierDestroyed();
-            temp = it;
             it = this->pickups_.begin();
-            if(it == temp) // Infinite loop avoidance, in case the pickup wasn't removed from the carrier somewhere in the carrierDestroy() procedure.
+            if(temp == *it) // Infinite loop avoidance, in case the pickup wasn't removed from the carrier somewhere in the carrierDestroy() procedure.
             {
-                COUT(2) << "Oops. In a PickupCarrier, while cleaning up, a Pickupable (&" << (*temp) << ") didn't unregister itself as it should have." << std::endl;;
+                COUT(2) << "Oops. In a PickupCarrier, while cleaning up, a Pickupable (&" << temp << ") didn't unregister itself as it should have." << std::endl;;
                 it++;
             }
         }




More information about the Orxonox-commit mailing list