瀏覽代碼

minor memory fix

Ken Martin 23 年之前
父節點
當前提交
85896b3460
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Source/cmMakefile.cxx

+ 2 - 2
Source/cmMakefile.cxx

@@ -96,12 +96,12 @@ cmMakefile::~cmMakefile()
     }
   std::list<cmFunctionBlocker *>::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<std::string>& v) const