Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5302 in orxonox.OLD


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
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/material.cc

    r4836 r5302  
    269269{
    270270  PRINTF(4)("setting Diffuse Map %s\n", dMap);
    271   if (this->diffuseTexture)
     271  if (this->diffuseTexture != NULL)
    272272    ResourceManager::getInstance()->unload(this->diffuseTexture);
    273273
  • trunk/src/util/resource_manager.cc

    r5219 r5302  
    399399  // if pointer is existent. and only one resource of this type exists.
    400400  Resource* tmpResource = this->locateResourceByPointer(pointer);
    401   if (!tmpResource)
     401  if (tmpResource == NULL)
    402402    {
    403403      PRINTF(2)("Resource not Found %p\n", pointer);
     
    460460          delete[] resource->name;
    461461          this->resourceList->remove(resource);
     462          delete resource;
    462463        }
    463464      else
  • 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.