diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1a79b9757..9208d83aa 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -96,12 +96,12 @@ cmMakefile::~cmMakefile() } std::list::iterator pos; for (pos = m_FunctionBlockers.begin(); - pos != m_FunctionBlockers.end(); pos = m_FunctionBlockers.begin()) + pos != m_FunctionBlockers.end(); ++pos) { cmFunctionBlocker* b = *pos; - m_FunctionBlockers.remove(*pos); delete b; } + m_FunctionBlockers.clear(); } void cmMakefile::PrintStringVector(const char* s, const std::vector& v) const