diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmMakefileGenerator.cxx | 11 | ||||
-rw-r--r-- | Source/cmMakefileGenerator.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmMakefileGenerator.cxx b/Source/cmMakefileGenerator.cxx index a662029..18d86c5 100644 --- a/Source/cmMakefileGenerator.cxx +++ b/Source/cmMakefileGenerator.cxx @@ -50,6 +50,17 @@ void cmMakefileGenerator::SetMakefile(cmMakefile* mf) m_Makefile = mf; } +void cmMakefileGenerator::UnRegisterGenerators() +{ + for(std::map<cmStdString, cmMakefileGenerator*>::iterator i + = s_RegisteredGenerators.begin(); + i != s_RegisteredGenerators.end(); ++i) + { + delete i->second; + } + s_RegisteredGenerators = std::map<cmStdString, cmMakefileGenerator*>(); +} + void cmMakefileGenerator::GetRegisteredGenerators(std::vector<std::string>& names) { for(std::map<cmStdString, cmMakefileGenerator*>::iterator i diff --git a/Source/cmMakefileGenerator.h b/Source/cmMakefileGenerator.h index e2da856..7165562 100644 --- a/Source/cmMakefileGenerator.h +++ b/Source/cmMakefileGenerator.h @@ -59,6 +59,8 @@ public: static cmMakefileGenerator* CreateGenerator(const char* name); ///! Register a generator static void RegisterGenerator(cmMakefileGenerator*); + ///! delete all registered generators, useful for clean up + static void UnRegisterGenerators(); ///! Get the names of the current registered generators static void GetRegisteredGenerators(std::vector<std::string>& names); |