mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmExportSetMap: Override clear() to delete held resources
Replace the std::map<>::clear() method with one that first deletes
the cmExportSet instances held by each map entry, and then clears.
Otherwise the cmGlobalGenerator::ClearGeneratorMembers added by
commit 5cf1120f (cmGlobalGenerator: Refactor member cleanup between
configures, 2013-11-04) leaks the cmExportSet instances.
This commit is contained in:
@@ -23,7 +23,7 @@ cmExportSet* cmExportSetMap::operator[](const std::string &name)
|
||||
return it->second;
|
||||
}
|
||||
|
||||
cmExportSetMap::~cmExportSetMap()
|
||||
void cmExportSetMap::clear()
|
||||
{
|
||||
for(std::map<std::string, cmExportSet*>::iterator it = this->begin();
|
||||
it != this->end();
|
||||
@@ -31,4 +31,10 @@ cmExportSetMap::~cmExportSetMap()
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
this->derived::clear();
|
||||
}
|
||||
|
||||
cmExportSetMap::~cmExportSetMap()
|
||||
{
|
||||
this->clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user