diff options
author | Brad King <brad.king@kitware.com> | 2008-05-27 15:18:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-05-27 15:18:01 (GMT) |
commit | 1c0ffdc11c20376b5a353634e63bfcb0fafc1cc0 (patch) | |
tree | a417b403df6067699227cfe140e91b4bd3de7e79 | |
parent | 757875df9151eb02e252caa4e4f5ee6522f5a99f (diff) | |
download | CMake-1c0ffdc11c20376b5a353634e63bfcb0fafc1cc0.zip CMake-1c0ffdc11c20376b5a353634e63bfcb0fafc1cc0.tar.gz CMake-1c0ffdc11c20376b5a353634e63bfcb0fafc1cc0.tar.bz2 |
BUG: Fix crash on repeated configure steps and exported targets.
- In cmGlobalGenerator the ExportSets ivar must be cleared at
the beginning of each Configure.
- See issue #7101.
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 27 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 1 |
2 files changed, 18 insertions, 10 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index dce60ff..33a7f20 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -72,16 +72,7 @@ cmGlobalGenerator::~cmGlobalGenerator() delete this->ExtraGenerator; } - for (std::map<cmStdString, std::vector<cmTargetExport*> >::iterator - setIt = this->ExportSets.begin(); - setIt != this->ExportSets.end(); - ++setIt) - { - for (unsigned int i = 0; i < setIt->second.size(); ++i) - { - delete setIt->second[i]; - } - } + this->ClearExportSets(); } // Find the make program for the generator, required for try compiles @@ -683,6 +674,7 @@ bool cmGlobalGenerator::IsDependedOn(const char* project, void cmGlobalGenerator::Configure() { this->FirstTimeProgress = 0.0f; + this->ClearExportSets(); // Delete any existing cmLocalGenerators unsigned int i; for (i = 0; i < this->LocalGenerators.size(); ++i) @@ -1232,6 +1224,21 @@ void cmGlobalGenerator::AddTargetToExports(const char* exportSetName, } } +//---------------------------------------------------------------------------- +void cmGlobalGenerator::ClearExportSets() +{ + for(std::map<cmStdString, std::vector<cmTargetExport*> >::iterator + setIt = this->ExportSets.begin(); + setIt != this->ExportSets.end(); ++setIt) + { + for(unsigned int i = 0; i < setIt->second.size(); ++i) + { + delete setIt->second[i]; + } + } + this->ExportSets.clear(); +} + const std::vector<cmTargetExport*>* cmGlobalGenerator::GetExportSet( const char* name) const { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 7991a33..519158f 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -293,6 +293,7 @@ protected: bool InstallTargetEnabled; // Sets of named target exports std::map<cmStdString, std::vector<cmTargetExport*> > ExportSets; + void ClearExportSets(); // Manifest of all targets that will be built for each configuration. // This is computed just before local generators generate. |