Use the cmDeleteAll algorithm for types derived from std::map.

This commit is contained in:
Stephen Kelly 2015-01-04 15:06:37 +01:00
parent 4dc0c488f9
commit 681d965df1
3 changed files with 4 additions and 21 deletions

View File

@ -25,12 +25,7 @@ cmExportSet* cmExportSetMap::operator[](const std::string &name)
void cmExportSetMap::clear()
{
for(std::map<std::string, cmExportSet*>::iterator it = this->begin();
it != this->end();
++ it)
{
delete it->second;
}
cmDeleteAll(*this);
this->derived::clear();
}

View File

@ -1510,11 +1510,7 @@ void cmGlobalGenerator::CreateGeneratorTargets()
//----------------------------------------------------------------------------
void cmGlobalGenerator::ClearGeneratorMembers()
{
for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin();
i != this->GeneratorTargets.end(); ++i)
{
delete i->second;
}
cmDeleteAll(this->GeneratorTargets);
this->GeneratorTargets.clear();
cmDeleteAll(this->EvaluationFiles);

View File

@ -539,12 +539,7 @@ void cmTarget::ClearLinkMaps()
this->Internal->LinkInterfaceUsageRequirementsOnlyMap.clear();
this->Internal->LinkClosureMap.clear();
this->Internal->SourceFilesMap.clear();
for (cmTargetLinkInformationMap::const_iterator it
= this->LinkInformation.begin();
it != this->LinkInformation.end(); ++it)
{
delete it->second;
}
cmDeleteAll(this->LinkInformation);
this->LinkInformation.clear();
}
@ -6874,10 +6869,7 @@ cmTargetLinkInformationMap
//----------------------------------------------------------------------------
cmTargetLinkInformationMap::~cmTargetLinkInformationMap()
{
for(derived::iterator i = this->begin(); i != this->end(); ++i)
{
delete i->second;
}
cmDeleteAll(*this);
}
//----------------------------------------------------------------------------