Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 6, 2005, 1:54:16 PM (20 years ago)
Author:
patrick
Message:

orxonox/trunk: whiped out a segfault, that is produced, when the Array::finalize() function is called multiple times

File:
1 edited

Legend:

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

    r4796 r4797  
    820820{
    821821  /* make sure, that all the arrays are finalized */
    822   this->vertices->finalizeArray();
    823   this->vTexture->finalizeArray();
     822  if( unlikely(!this->vertices->isFinalized()))
     823    this->vertices->finalizeArray();
     824  if( unlikely(!this->vTexture->isFinalized()))
     825    this->vTexture->finalizeArray();
    824826  if( normals->getCount() == 0) // vertices-Array must be built for this
    825827    this->buildVertexNormals();
    826   this->normals->finalizeArray();
     828  if( unlikely(!this->normals->isFinalized()))
     829    this->normals->finalizeArray();
    827830
    828831
     
    855858  }
    856859
     860  PRINTF(0)("***************************************GOT %i triangles\n", this->triangleCount);
     861
    857862  /* allocate memory for the new triangle structures */
    858   if( unlikely((this->triangles = new sTriangleExt[this->vertices->getCount()]) == 0));
     863  if( unlikely((this->triangles = new sTriangleExt[this->triangleCount]) == 0));
    859864  {
    860865    PRINTF(2)("Could not allocate memory for triangle list\n");
Note: See TracChangeset for help on using the changeset viewer.