From 58a3e38167e01834c50343777c9223fa233de62e Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 14 Sep 2001 15:18:01 -0400 Subject: add support for clean up --- Source/cmMakefileGenerator.cxx | 11 +++++++++++ Source/cmMakefileGenerator.h | 2 ++ 2 files changed, 13 insertions(+) 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::iterator i + = s_RegisteredGenerators.begin(); + i != s_RegisteredGenerators.end(); ++i) + { + delete i->second; + } + s_RegisteredGenerators = std::map(); +} + void cmMakefileGenerator::GetRegisteredGenerators(std::vector& names) { for(std::map::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& names); -- cgit v0.12