Changeset 4592 in orxonox.OLD for orxonox/trunk/src/util/garbage_collector.cc
- Timestamp:
- Jun 10, 2005, 7:17:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/garbage_collector.cc
r4519 r4592 1 /* 1 /* 2 2 orxonox - the future of 3D-vertical-scrollers 3 3 … … 33 33 \brief standard constructor 34 34 */ 35 GarbageCollector::GarbageCollector () 35 GarbageCollector::GarbageCollector () 36 36 { 37 37 this->setClassID(CL_GARBAGE_COLLECTOR, "GarbageCollector"); … … 44 44 \brief standard deconstructor 45 45 */ 46 GarbageCollector::~GarbageCollector () 46 GarbageCollector::~GarbageCollector () 47 47 { 48 48 // delete what has to be deleted here … … 52 52 \brief this sets the collection delay 53 53 \param delay: the delay 54 54 55 55 after this delay, the garbage collector starts its work and begins to collect unused object 56 56 to delete them afterwards. only objects in the worldentity list from the world object are lookded 57 at. 57 at. 58 58 */ 59 59 void GarbageCollector::setCollectionDelay(float delay) … … 107 107 tIterator<WorldEntity>* iterator = list->getIterator(); 108 108 WorldEntity* entity = iterator->nextElement(); 109 while( entity != NULL) 110 { 109 while( entity != NULL) 110 { 111 111 if( entity->isFinalized()) 112 113 114 115 116 117 118 119 120 121 122 ObjectManager::getInstance()->addToDeadList(entity->getClassID(), entity);123 112 { 113 PRINTF(4)("= finalizing object\n"); 114 ++counter; 115 116 /* first remove out of entity list */ 117 list->remove(entity); 118 /* second remove out of pnode tree */ 119 entity->remove(); 120 /* then finaly delete reference */ 121 //delete entity; 122 ObjectManager::getInstance()->addToDeadList(entity->getClassID() & CL_MASK_LOWLEVEL_CLASS, entity); 123 } 124 124 entity = iterator->nextElement(); 125 125 }
Note: See TracChangeset
for help on using the changeset viewer.