Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5948 in orxonox.OLD for trunk/src/lib/parser/ini_parser


Ignore:
Timestamp:
Dec 7, 2005, 12:56:40 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: iniparser cleans itself up

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/parser/ini_parser/ini_parser.cc

    r5947 r5948  
    5656{
    5757  this->deleteSections();
     58  this->setFileName(NULL);
    5859}
    5960
     
    7475      // delete all strings of entries.
    7576      IniEntry entry = section.entries.front();
    76       delete []entry.name;
    77       delete []entry.value;
     77      delete[] entry.name;
     78      delete[] entry.value;
     79      delete[] entry.comment;
    7880      section.entries.pop_front();
    7981    }
    8082    // delete all Sections
    81     delete []section.name;
     83    delete[] section.name;
     84    delete[] section.comment;
    8285    this->sections.pop_front();
    8386  }
     
    9497void IniParser::setFileName(const char* fileName)
    9598{
    96   if (this->fileName)
    97     delete []this->fileName;
     99  if (this->fileName != NULL)
     100    delete[] this->fileName;
     101  if  (this->comment != NULL)
     102    delete[] this->comment;
     103  this->comment = NULL;
     104
    98105  if (fileName != NULL)
    99106  {
Note: See TracChangeset for help on using the changeset viewer.