diff options
author | Brad King <brad.king@kitware.com> | 2013-11-08 14:33:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-11-08 14:35:56 (GMT) |
commit | 00055ce76d947ee0a35394edcafee1e85df5da53 (patch) | |
tree | a26de97085b5460379f2c87eaf2500c2a70bc7e3 /Source/cmExportSetMap.cxx | |
parent | 5cf1120fbf11fcc6bb5f5f15b0e2c8472bafc261 (diff) | |
download | CMake-00055ce76d947ee0a35394edcafee1e85df5da53.zip CMake-00055ce76d947ee0a35394edcafee1e85df5da53.tar.gz CMake-00055ce76d947ee0a35394edcafee1e85df5da53.tar.bz2 |
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.
Diffstat (limited to 'Source/cmExportSetMap.cxx')
-rw-r--r-- | Source/cmExportSetMap.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx index 96fdb3e..5174118 100644 --- a/Source/cmExportSetMap.cxx +++ b/Source/cmExportSetMap.cxx @@ -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(); } |