diff options
author | Brad King <brad.king@kitware.com> | 2013-11-12 13:31:39 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-11-12 13:31:39 (GMT) |
commit | cb4a4686ac807182fd86544fec10547428a83804 (patch) | |
tree | 61fc72f6b50e870a43d650bd9af805cee634493a /Source | |
parent | 4a762aa31257cb8518f98415686a27abaa7cd042 (diff) | |
parent | 00055ce76d947ee0a35394edcafee1e85df5da53 (diff) | |
download | CMake-cb4a4686ac807182fd86544fec10547428a83804.zip CMake-cb4a4686ac807182fd86544fec10547428a83804.tar.gz CMake-cb4a4686ac807182fd86544fec10547428a83804.tar.bz2 |
Merge topic 'clear-generator-data'
00055ce cmExportSetMap: Override clear() to delete held resources
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExportSetMap.cxx | 8 | ||||
-rw-r--r-- | Source/cmExportSetMap.h | 3 |
2 files changed, 10 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(); } diff --git a/Source/cmExportSetMap.h b/Source/cmExportSetMap.h index 4663c55..965046c 100644 --- a/Source/cmExportSetMap.h +++ b/Source/cmExportSetMap.h @@ -18,6 +18,7 @@ class cmExportSet; /// A name -> cmExportSet map with overloaded operator[]. class cmExportSetMap : public std::map<std::string, cmExportSet*> { + typedef std::map<std::string, cmExportSet*> derived; public: /** \brief Overloaded operator[]. * @@ -26,6 +27,8 @@ public: */ cmExportSet* operator[](const std::string &name); + void clear(); + /// Overloaded destructor deletes all member export sets. ~cmExportSetMap(); }; |