1
0
Fork 0

Add destroying of sections in the config destructor.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@351
This commit is contained in:
Sjoerd van der Berg 2002-10-19 15:49:40 +00:00
parent 0b581f1924
commit 9efdfcdf1f

View file

@ -196,10 +196,19 @@ Section_line* Config::AddSection_line(const char* _name,void (*_initfunction)(Se
void Config::Init(){
for (it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){
LOG_DEBUG("Init %s",(*tel)->sectionname.c_str());
(*tel)->ExecuteInit();
}
}
Config::~Config() {
reverse_it cnt=sectionlist.rbegin();
while (cnt!=sectionlist.rend()) {
delete (*cnt);
cnt++;
}
}
Section* Config::GetSection(const char* _sectionname){
for (it tel=sectionlist.begin(); tel!=sectionlist.end(); tel++){
if ( (*tel)->sectionname==_sectionname) return (*tel);
@ -248,9 +257,6 @@ void Config::StartUp(void) {
(*_start_function)();
}
bool CommandLine::FindExist(char * name,bool remove) {
cmd_it it;
if (!(FindEntry(name,it,false))) return false;