[Orxonox-commit 3246] r7937 - code/trunk/src/orxonox/worldentities
landauf at orxonox.net
landauf at orxonox.net
Sun Feb 20 18:06:09 CET 2011
Author: landauf
Date: 2011-02-20 18:06:09 +0100 (Sun, 20 Feb 2011)
New Revision: 7937
Modified:
code/trunk/src/orxonox/worldentities/WorldEntity.cc
Log:
fixing WE crash also in trunk since it's a rather severe problem
Modified: code/trunk/src/orxonox/worldentities/WorldEntity.cc
===================================================================
--- code/trunk/src/orxonox/worldentities/WorldEntity.cc 2011-02-20 16:45:04 UTC (rev 7936)
+++ code/trunk/src/orxonox/worldentities/WorldEntity.cc 2011-02-20 17:06:09 UTC (rev 7937)
@@ -122,12 +122,14 @@
std::set<WorldEntity*>::iterator it;
while ((it = this->children_.begin()) != this->children_.end())
{
+ WorldEntity* entity = *it;
+
// do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to smart pointers pointing to it
- (*it)->setPosition((*it)->getWorldPosition());
- this->detach(*it); // detach also erases the element from the children set
+ entity->setPosition(entity->getWorldPosition());
+ this->detach(entity); // detach also erases the element from the children set
- if ((*it)->getDeleteWithParent())
- (*it)->destroy();
+ if (entity->getDeleteWithParent())
+ entity->destroy();
}
if (this->physicalBody_)
More information about the Orxonox-commit
mailing list