Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 13, 2005, 10:50:43 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: all WorldEntities/PWodes now destroy all date they alocate.

this is done with a virtual destructor:
if PNode is deleted it calls for the delete of the virtual destructor, and deletes the data of it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/world_entities/world_entity.cc

    r3474 r3531  
    4747{
    4848  // if( collisioncluster != NULL) delete collisioncluster;
    49 }
     49  this->destroy();
     50}
     51
     52/**
     53   \brief Function to call if a WorldEntity is destroyed. deletes all alocated memory.
     54   */
     55void WorldEntity::destroy()
     56{
     57
     58  // delete everything of pNode.
     59  static_cast<PNode*>(this)->destroy();
     60}
     61
    5062
    5163/**
     
    156168void WorldEntity::hit(WorldEntity* weapon, Vector loc) {}
    157169
    158 /**
    159    \brief this function is called when the entity is to be destroied
    160    
    161    This can be called, if eg. something realy bad happens :)
    162 */
    163 void WorldEntity::destroy() {}
    164170
    165171
Note: See TracChangeset for help on using the changeset viewer.