Procházet zdrojové kódy

BUG: Fix memory leak in Core/ctkDependencyGraph

The instantiated QVarLengthArray arrays weren't deleted.
Jean-Christophe Fillion-Robin před 15 roky
rodič
revize
399e8be1f8
1 změnil soubory, kde provedl 6 přidání a 0 odebrání
  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; 
 }