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:
parent
0b581f1924
commit
9efdfcdf1f
1 changed files with 9 additions and 3 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue