Changeset 3669 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Mar 30, 2005, 12:06:36 PM (20 years ago)
- Location:
- orxonox/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/garbage_collector.cc
r3668 r3669 116 116 return; 117 117 /* garbage collect */ 118 PRINTF(3)("GarbageCollection is been done\n"); 118 PRINTF(3)("=============================\n"); 119 PRINTF(3)("Processing Garbage Collection\n"); 120 PRINTF(3)("=============================\n"); 121 int counter = 0; 119 122 WorldInterface* wi = WorldInterface::getInstance(); 120 123 tList<WorldEntity>* list = wi->getEntityList(); … … 126 129 if( entity->isFinalized()) 127 130 { 128 PRINTF(1)("Finalizing object in list - not yet done realy\n"); 131 PRINTF(4)("= finalizing object\n"); 132 ++counter; 129 133 130 134 /* first remove out of entity list */ 131 135 list->remove(entity); 132 136 /* second remove out of pnode tree */ 133 //entity->remove();134 //delete entity;137 entity->remove(); 138 delete entity; 135 139 } 136 140 entity = iterator->nextElement(); 137 141 } 142 PRINTF(3)("= collected %i unused objects\n", counter); 143 PRINTF(3)("=============================\n"); 138 144 145 146 147 139 148 /* reset time to count again up to this->delay */ 140 149 this->time = 0; -
orxonox/trunk/src/lib/coord/null_parent.cc
r3644 r3669 83 83 *this->absCoordinate = *this->relCoordinate; 84 84 *this->absDirection = parent->getAbsDir () * *this->relDirection; 85 86 PNode* pn = this->children->enumerate (); 85 86 tIterator<PNode>* iterator = this->children->getIterator(); 87 //PNode* pn = this->children->enumerate (); 88 PNode* pn = iterator->nextElement(); 87 89 while( pn != NULL) 88 90 { … … 93 95 pn->parentDirChanged (); 94 96 pn->update (dt); 95 pn = this->children->nextElement (); 97 //pn = this->children->nextElement (); 98 pn = iterator->nextElement(); 96 99 } 97 100 -
orxonox/trunk/src/lib/coord/p_node.cc
r3668 r3669 354 354 { 355 355 pNode->remove(); 356 //this->children->remove (pNode);356 this->children->remove (pNode); 357 357 pNode->parent = NULL; 358 358 } … … 378 378 } 379 379 delete iterator; 380 //this->parent->removeChild(this);380 this->parent->children->remove(this); 381 381 } 382 382 … … 499 499 500 500 501 PNode* pn = this->children->enumerate(); 501 tIterator<PNode>* iterator = this->children->getIterator(); 502 //PNode* pn = this->children->enumerate(); 503 PNode* pn = iterator->nextElement(); 502 504 while( pn != NULL) 503 505 { … … 509 511 510 512 pn->update(dt); 511 pn = this->children->nextElement(); 512 } 513 //pn = this->children->nextElement(); 514 pn = iterator->nextElement(); 515 } 516 delete iterator; 513 517 514 518 this->timeStamp = timeStamp; -
orxonox/trunk/src/lib/util/list.h
r3668 r3669 65 65 private: 66 66 listElement<T>* currentEl; 67 listElement<T>* firstEl; 68 int counter; 67 listElement<T>* tmpEl; 69 68 }; 70 69 … … 74 73 { 75 74 this->currentEl = startElement; 76 this->firstEl = startElement; 77 if( this->firstEl != NULL) 78 this->counter = -1; 79 else 80 this->counter = 0; 75 this->tmpEl = NULL; 81 76 } 82 77 … … 92 87 inline T* tIterator<T>::nextElement () 93 88 { 94 /*95 this->counter++;96 if( this->counter == 0)97 return this->firstEl->curr;98 */99 100 89 if( this->currentEl == NULL) 101 90 return NULL; 102 91 103 listElement<T>* tmp= this->currentEl;92 this->tmpEl = this->currentEl; 104 93 this->currentEl = this->currentEl->next; 105 return t mp->curr;94 return this->tmpEl->curr; 106 95 } 107 96
Note: See TracChangeset
for help on using the changeset viewer.