瀏覽代碼

BUG: Fix memory leak in Core/ctkDependencyGraph

The instantiated QVarLengthArray arrays weren't deleted.
Jean-Christophe Fillion-Robin 15 年之前
父節點
當前提交
399e8be1f8
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Libs/Core/ctkDependencyGraph.cxx

+ 6 - 0
Libs/Core/ctkDependencyGraph.cxx

@@ -221,6 +221,12 @@ ctkDependencyGraph::ctkDependencyGraph(int nvertices, int nedges)
 //----------------------------------------------------------------------------
 ctkDependencyGraph::~ctkDependencyGraph()
 {
+  // Clean memory
+  for (int i=0; i <= this->Internal->NVertices; i++)
+    {
+    delete this->Internal->Edges[i];
+    }
+    
   delete this->Internal; 
 }