[Orxonox-commit 6889] r11510 - in code/branches/HUD_HS16/src: modules/overlays/hud modules/pickup orxonox/interfaces

patricwi at orxonox.net patricwi at orxonox.net
Mon Oct 23 16:41:56 CEST 2017


Author: patricwi
Date: 2017-10-23 16:41:56 +0200 (Mon, 23 Oct 2017)
New Revision: 11510

Modified:
   code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc
   code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc
   code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
   code/branches/HUD_HS16/src/orxonox/interfaces/Pickupable.cc
Log:
looking for SEGFault

Modified: code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc
===================================================================
--- code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc	2017-10-23 14:19:11 UTC (rev 11509)
+++ code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupItem.cc	2017-10-23 14:41:56 UTC (rev 11510)
@@ -58,10 +58,10 @@
 
     HUDPickupItem::~HUDPickupItem()
     {
-        if (this->isInitialized())
+        /*if (this->isInitialized())
         {
             overlayElement_=nullptr;
-        }
+        }*/
     }
 
     void HUDPickupItem::initializeMaterial(const std::string& s, float x, float y)
@@ -78,6 +78,6 @@
         assert(overlayElement_);
         assert(this->background_);
         overlayElement_->hide();
-        this->background_->removeChild(overlayElement_->getName());
+        //this->background_->removeChild(overlayElement_->getName());
     }
 }

Modified: code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc
===================================================================
--- code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc	2017-10-23 14:19:11 UTC (rev 11509)
+++ code/branches/HUD_HS16/src/modules/overlays/hud/HUDPickupSystem.cc	2017-10-23 14:41:56 UTC (rev 11510)
@@ -55,10 +55,10 @@
 
     HUDPickupSystem::~HUDPickupSystem()
     {
-        if (this->isInitialized())
+        /*if (this->isInitialized())
         {
             this->picks.clear();
-        }
+        }*/
     }
 
     void HUDPickupSystem::sizeChanged()
@@ -106,13 +106,16 @@
     void HUDPickupSystem::removePickup(Pickupable* pickup)
     {
         assert(pickup);
+        orxout()<< "removePickup called with " << pickup << endl;
         HUDPickupItem* item = this->picks.find(pickup)->second;
-        orxout(internal_info, context::pickups) << "removePickup: pickup= " << pickup << " item= " << item << endl;
-        assert(item);
+        orxout() << "removePickup: pickup= " << pickup << " item= " << item << endl;
+        //assert(item);
         item->hideMe(pickup, repaint);
-        assert(overlayElement_);
-        assert(this->background_);
-        this->picks.erase(pickup);
+        orxout() << "i am hidden now" << endl;
+        //assert(overlayElement_);
+        //assert(this->background_);
+        //this->picks.erase(pickup);
+        orxout()<< "end removePickup method" << endl;
     }
 
     void HUDPickupSystem::destroyAll()

Modified: code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc
===================================================================
--- code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc	2017-10-23 14:19:11 UTC (rev 11509)
+++ code/branches/HUD_HS16/src/modules/pickup/PickupManager.cc	2017-10-23 14:41:56 UTC (rev 11510)
@@ -102,10 +102,9 @@
 
         // Destroying all the WeakPointers that are still there.
         this->pickups_.clear();
-
         this->indexes_.clear();
 
-        orxout(internal_info, context::pickups) << "PickupManager destroyed." << endl;
+        orxout() << "PickupManager destroyed." << endl;
     }
 
     /**
@@ -316,6 +315,7 @@
 
             if(pickupSystem)
                 pickupSystem->removePickup(pickup);
+            orxout() << "end of pickupChangedPickedUp" << endl;
         }
 
         // If we're either in standalone mode or this is the host whom the change of the pickup's status concerns.

Modified: code/branches/HUD_HS16/src/orxonox/interfaces/Pickupable.cc
===================================================================
--- code/branches/HUD_HS16/src/orxonox/interfaces/Pickupable.cc	2017-10-23 14:19:11 UTC (rev 11509)
+++ code/branches/HUD_HS16/src/orxonox/interfaces/Pickupable.cc	2017-10-23 14:41:56 UTC (rev 11510)
@@ -79,6 +79,7 @@
 
         if(this->isPickedUp())
             this->drop(false); // Drops the pickup without creating a PickupSpawner.
+        orxout()<< "end of preDestroy" << endl;
     }
 
     /**
@@ -97,10 +98,12 @@
     */
     void Pickupable::destroyPickup(void)
     {
+        orxout()<< "beginning of actual destroy" << endl;
         if(!this->isBeingDestroyed())
             this->Destroyable::destroy();
         else
             orxout(internal_warning, context::pickups) << this->getIdentifier()->getName() << " may be unsafe. " << endl;
+        orxout()<<"end of actual destroy" << endl;
     }
 
     /**



More information about the Orxonox-commit mailing list