Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5227 in orxonox.OLD for trunk/src/util


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 :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.