diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2001-06-04 14:18:03 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2001-06-04 14:18:03 (GMT) |
commit | a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf (patch) | |
tree | 73155ed903d3138946d64f4da4631954c8601b4e /Source/cmMakefile.cxx | |
parent | abab6bc00069df6ff1988abced39b98ea199febc (diff) | |
download | CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.zip CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.tar.gz CMake-a3cfcd9894a5d626b8beba80fc8b5934ea3f46cf.tar.bz2 |
BUG: clean up memory leaks.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 134fdf9..446729e 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -111,6 +111,14 @@ cmMakefile::~cmMakefile() delete d->second; } } + std::set<cmFunctionBlocker *>::const_iterator pos; + for (pos = m_FunctionBlockers.begin(); + pos != m_FunctionBlockers.end(); ++pos) + { + cmFunctionBlocker* b = *pos; + m_FunctionBlockers.erase(*pos); + delete b; + } delete m_MakefileGenerator; } @@ -189,7 +197,10 @@ bool cmMakefile::ReadListFile(const char* filename, const char* external) // keep track of the current file being read if (filename) { - m_cmCurrentListFile= filename; + if(m_cmCurrentListFile != filename) + { + m_cmCurrentListFile = filename; + } } // if this is not a remote makefile @@ -342,6 +353,10 @@ void cmMakefile::AddCommand(cmCommand* wg) // Set the make file void cmMakefile::SetMakefileGenerator(cmMakefileGenerator* mf) { + if(mf == m_MakefileGenerator) + { + return; + } delete m_MakefileGenerator; m_MakefileGenerator = mf; mf->SetMakefile(this); @@ -836,7 +851,7 @@ bool cmMakefile::IsFunctionBlocked(const char *name, } void cmMakefile::RemoveFunctionBlocker(const char *name, - const std::vector<std::string> &args) + const std::vector<std::string> &args) { // loop over all function blockers to see if any block this command std::set<cmFunctionBlocker *>::const_iterator pos; @@ -845,7 +860,9 @@ void cmMakefile::RemoveFunctionBlocker(const char *name, { if ((*pos)->ShouldRemove(name, args, *this)) { + cmFunctionBlocker* b = *pos; m_FunctionBlockers.erase(*pos); + delete b; return; } } |