Browse Source

Fixed crash on deletion of Object children.

setParent(0) modifies list of children in parent object, thus the for
cycle will break. Curious that I didn't notice that before.
pull/279/head
Vladimír Vondruš 14 years ago
parent
commit
d40a80b3d0
  1. 4
      src/Object.cpp

4
src/Object.cpp

@ -74,8 +74,8 @@ Object::~Object() {
setParent(nullptr);
/* Delete all children */
for(set<Object*>::const_iterator it = _children.begin(); it != _children.end(); ++it)
delete *it;
while(!_children.empty())
delete *_children.begin();
}
Scene* Object::scene() const {

Loading…
Cancel
Save