Changeset 5214 in orxonox.OLD for trunk/src/lib/graphics/render2D
- Timestamp:
- Sep 21, 2005, 8:46:28 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/render2D/element_2d.cc
r5212 r5214 54 54 Render2D::getInstance()->unregisterElement2D(this); 55 55 56 tIterator<Element2D>* iterator = this->children->getIterator();57 Element2D* pn = iterator->firstElement();58 while( pn != NULL)59 {60 delete pn;61 pn = iterator->nextElement();62 }63 delete iterator;64 /* this deletes all children in the list */65 delete this->children;66 56 if (this->parent) 67 57 this->parent->removeChild2D(this); 58 else 59 { 60 tIterator<Element2D>* iterator = this->children->getIterator(); 61 Element2D* pn = iterator->firstElement(); 62 while( pn != NULL) 63 { 64 delete pn; 65 pn = iterator->nextElement(); 66 } 67 delete iterator; 68 /* this deletes all children in the list */ 69 } 70 delete this->children; 68 71 69 72 if (this->toCoordinate != NULL) … … 470 473 { 471 474 child->remove2D(); 472 this->children->remove(child);473 child->parent = NULL;475 // this->children->remove(child); 476 // child->parent = NULL; 474 477 } 475 478 } … … 491 494 } 492 495 delete iterator; 493 this->parent->children->remove(this); 496 if (this->parent != NULL) 497 this->parent->children->remove(this); 494 498 } 495 499
Note: See TracChangeset
for help on using the changeset viewer.