Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7936 for code/branches


Ignore:
Timestamp:
Feb 20, 2011, 5:45:04 PM (14 years ago)
Author:
landauf
Message:

trying to fix a crash

File:
1 edited

Legend:

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

    r7910 r7936  
    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.