Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4592 in orxonox.OLD for orxonox/trunk/src/util/garbage_collector.cc


Ignore:
Timestamp:
Jun 10, 2005, 7:17:22 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: derivations work.
now the only thing to do is specify all the classes, and DO it CLEAN.

@patrick: is it ok, how i treated your ObjectManager??

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/util/garbage_collector.cc

    r4519 r4592  
    1 /* 
     1/*
    22   orxonox - the future of 3D-vertical-scrollers
    33
     
    3333   \brief standard constructor
    3434*/
    35 GarbageCollector::GarbageCollector () 
     35GarbageCollector::GarbageCollector ()
    3636{
    3737   this->setClassID(CL_GARBAGE_COLLECTOR, "GarbageCollector");
     
    4444   \brief standard deconstructor
    4545*/
    46 GarbageCollector::~GarbageCollector () 
     46GarbageCollector::~GarbageCollector ()
    4747{
    4848  // delete what has to be deleted here
     
    5252   \brief this sets the collection delay
    5353   \param delay: the delay
    54    
     54
    5555   after this delay, the garbage collector starts its work and begins to collect unused object
    5656   to delete them afterwards. only objects in the worldentity list from the world object are lookded
    57    at. 
     57   at.
    5858*/
    5959void GarbageCollector::setCollectionDelay(float delay)
     
    107107  tIterator<WorldEntity>* iterator = list->getIterator();
    108108  WorldEntity* entity = iterator->nextElement();
    109   while( entity != NULL) 
    110     { 
     109  while( entity != NULL)
     110    {
    111111      if( entity->isFinalized())
    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(), 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        }
    124124      entity = iterator->nextElement();
    125125    }
Note: See TracChangeset for help on using the changeset viewer.