Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7732 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
May 19, 2006, 4:32:27 PM (19 years ago)
Author:
patrick
Message:

orxonox: removed a memory leak

Location:
trunk/src/lib/graphics/importer
Files:
3 edited

Legend:

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

    r7221 r7732  
    125125MD2Model::~MD2Model()
    126126{
     127  this->pModelInfo.pVertices = NULL;
     128  this->pModelInfo.pNormals = NULL;
     129  this->pModelInfo.pTexCoor = NULL;
     130  this->pModelInfo.pTriangles = NULL;
     131
    127132  ResourceManager::getInstance()->unload(this->data);
    128133}
     
    408413  delete [] this->pLightNormals;
    409414  delete [] this->pTexCoor;
    410 
    411415}
    412416
  • trunk/src/lib/graphics/importer/model.cc

    r7194 r7732  
    4545*/
    4646Model::~Model()
    47 { }
     47{
     48  if( this->pModelInfo.pVertices != NULL)
     49    delete [] this->pModelInfo.pVertices;
     50
     51  if( this->pModelInfo.pTriangles != NULL)
     52    delete [] this->pModelInfo.pTriangles;
     53
     54  if( this->pModelInfo.pNormals != NULL)
     55    delete [] this->pModelInfo.pNormals;
     56
     57  if( this->pModelInfo.pTexCoor != NULL)
     58    delete [] this->pModelInfo.pTexCoor;
     59}
    4860
    4961
  • trunk/src/lib/graphics/importer/static_model.cc

    r7711 r7732  
    185185    delete (*modMat);
    186186  }
     187
     188  // mark this stuff as beeing deleted
     189  this->pModelInfo.pVertices = NULL;
     190  this->pModelInfo.pNormals = NULL;
     191  this->pModelInfo.pTexCoor = NULL;
    187192}
    188193
Note: See TracChangeset for help on using the changeset viewer.