mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r15121) -Fix: more mem-leak fixes (this should make SmatZ so happy ;) :p)
This commit is contained in:
parent
fe90077681
commit
27717e1b6d
|
@ -55,7 +55,11 @@ AIConfig::AIConfig(const AIConfig *config)
|
||||||
|
|
||||||
AIConfig::~AIConfig()
|
AIConfig::~AIConfig()
|
||||||
{
|
{
|
||||||
this->ChangeAI(NULL);
|
free((void *)this->name);
|
||||||
|
for (SettingValueList::iterator it = this->settings.begin(); it != this->settings.end(); it++) {
|
||||||
|
free((void*)(*it).first);
|
||||||
|
}
|
||||||
|
this->settings.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
AIInfo *AIConfig::GetInfo()
|
AIInfo *AIConfig::GetInfo()
|
||||||
|
|
|
@ -179,6 +179,7 @@ AIScanner::~AIScanner()
|
||||||
delete (*lit).second;
|
delete (*lit).second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete this->info_dummy;
|
||||||
delete this->engine;
|
delete this->engine;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -331,7 +332,7 @@ void AIScanner::RegisterAI(AIInfo *info)
|
||||||
strtolower(ai_name);
|
strtolower(ai_name);
|
||||||
if (this->info_single_list.find(ai_name) == this->info_single_list.end()) {
|
if (this->info_single_list.find(ai_name) == this->info_single_list.end()) {
|
||||||
this->info_single_list[strdup(ai_name)] = info;
|
this->info_single_list[strdup(ai_name)] = info;
|
||||||
} else if (this->info_single_list[strdup(ai_name)]->GetVersion() < info->GetVersion()) {
|
} else if (this->info_single_list[ai_name]->GetVersion() < info->GetVersion()) {
|
||||||
this->info_single_list[ai_name] = info;
|
this->info_single_list[ai_name] = info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue