Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5302 in orxonox.OLD for trunk/src/world_entities


Ignore:
Timestamp:
Oct 7, 2005, 2:28:45 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: fixed bug in SkyShphere, doubly deleted Model

Location:
trunk/src/world_entities
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/world_entities/satellite.cc

    r4836 r5302  
    4444Satellite::~Satellite ()
    4545{
    46   // if( collisioncluster != NULL) delete collisioncluster;
    47   if (this->model)
    48     ResourceManager::getInstance()->unload(this->model);
    4946}
    5047
  • trunk/src/world_entities/skybox.cc

    r5212 r5302  
    103103  delete []this->material;
    104104  delete this->model;
     105  this->model = NULL; //< so that WorldEntity does not try to delete it again.
    105106}
    106107
  • trunk/src/world_entities/weapons/weapon.cc

    r5143 r5302  
    5555      delete this->animation[i];
    5656  for (int i = 0; i < WA_ACTION_COUNT; i++)
    57     if (this->soundBuffers[i])
     57    if (this->soundBuffers[i] != NULL && ClassList::exists(this->soundBuffers[i], CL_SOUND_BUFFER))
    5858      ResourceManager::getInstance()->unload(this->soundBuffers[i]);
    5959
  • trunk/src/world_entities/world_entity.cc

    r5300 r5302  
    5555{
    5656  // if( collisioncluster != NULL) delete collisioncluster;
    57   if (this->model)
     57  if (likely(this->model != NULL))
    5858    ResourceManager::getInstance()->unload(this->model);
    59   if( this->obbTree)
     59  if( this->obbTree != NULL)
    6060    delete this->obbTree;
    6161}
Note: See TracChangeset for help on using the changeset viewer.