Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7937 for code/trunk/src


Ignore:
Timestamp:
Feb 20, 2011, 6:06:09 PM (14 years ago)
Author:
landauf
Message:

fixing WE crash also in trunk since it's a rather severe problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/orxonox/worldentities/WorldEntity.cc

    r7910 r7937  
    123123            while ((it = this->children_.begin()) != this->children_.end())
    124124            {
     125                WorldEntity* entity = *it;
     126
    125127                // do this for all children, because even if getDeleteWithParent() returns true a child might still stay active due to smart pointers pointing to it
    126                 (*it)->setPosition((*it)->getWorldPosition());
    127                 this->detach(*it); // detach also erases the element from the children set
    128 
    129                 if ((*it)->getDeleteWithParent())
    130                     (*it)->destroy();
     128                entity->setPosition(entity->getWorldPosition());
     129                this->detach(entity); // detach also erases the element from the children set
     130
     131                if (entity->getDeleteWithParent())
     132                    entity->destroy();
    131133            }
    132134
Note: See TracChangeset for help on using the changeset viewer.