Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5227 in orxonox.OLD


Ignore:
Timestamp:
Sep 23, 2005, 11:24:18 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: LoadParam had some major memory-leak… fixed them :)

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell.cc

    r5209 r5227  
    8282{
    8383  // delete the displayable Buffers
    84   for (int i = 0; i < this->bufferDisplaySize; i++)
     84  for (unsigned int i = 0; i < this->bufferDisplaySize; i++)
    8585    delete this->bufferText[i];
    8686  delete[] this->bufferText;
     
    106106
    107107  ShellBuffer::getInstance()->getBufferIterator()->lastElement();
    108   for (int i = 0; i < this->bufferDisplaySize; i++)
     108  for (unsigned int i = 0; i < this->bufferDisplaySize; i++)
    109109    this->bufferText[i]->setText(ShellBuffer::getInstance()->getBufferIterator()->prevElement(), true);
    110110}
  • trunk/src/orxonox.cc

    r5226 r5227  
    177177
    178178  // initialize everything
    179   SDL_InitSubSystem (SDL_INIT_TIMER);
     179  SDL_Init(SDL_INIT_TIMER);
    180180  if( initResources () == -1) return -1;
    181181  if( initVideo() == -1) return -1;
  • trunk/src/util/loading/load_param.cc

    r5226 r5227  
    7777        strcpy(this->paramDesc->types[i], tmpTypeName);
    7878
     79        //! @todo SWITCH CASE WITH l_[TYPE]_TYPE -> much faster
    7980          // default value description
    8081        if (!strcmp(tmpTypeName, l_INT_NAME))
     
    249250    }
    250251  delete iterator;
     252  delete this->paramList;
    251253
    252254  delete[] this->className;
     
    311313        {
    312314          delete iterator;
    313           return enumParamDesc;
     315          //return enumParamDesc;
     316          return NULL;
    314317        }
    315318      enumParamDesc = iterator->nextElement();
     
    317320  delete iterator;
    318321
    319   this->paramList->add(new LoadParamDescription(paramName));
    320   return paramList->lastElement();
     322  LoadParamDescription* newParam = new LoadParamDescription(paramName);
     323
     324  this->paramList->add(newParam);
     325  return newParam;
    321326}
    322327
Note: See TracChangeset for help on using the changeset viewer.