Fixed a couple of memory leaks
authorAmit Sharma <asharma6@uiuc.edu>
Mon, 14 Nov 2005 22:38:18 +0000 (22:38 +0000)
committerAmit Sharma <asharma6@uiuc.edu>
Mon, 14 Nov 2005 22:38:18 +0000 (22:38 +0000)
src/ck-ldb/TopoCentLB.C
src/ck-ldb/TopoCentLB.h
src/ck-ldb/TopoLB.C

index 898b9d4036fe840683cb462cd1233e7d69ec3a71..ea521669951e98460a5b432523f2453f26481824 100644 (file)
@@ -51,7 +51,6 @@ CmiBool TopoCentLB::QueryBalanceNow (int _step)
 }
 
 TopoCentLB::~TopoCentLB(){
-       if(partgraph)   delete partgraph;
        if(topo) delete topo;
 }
 
@@ -698,6 +697,8 @@ void TopoCentLB :: work(CentralLB::LDStats *stats,int count)
 
        delete[] hopCount;
        delete[] heapMapping;
+       
+  delete partgraph;
 }
 
 #include "TopoCentLB.def.h"
index bc6584e78e1856857014772102b5367e4a9893fb..7557c2f57798d21cf8ad1cf214f8754ed660c861 100644 (file)
@@ -81,6 +81,9 @@ class TopoCentLB : public CentralLB
         for(int i=0;i<n_nodes;i++)
           delete[] nodes[i].obj_list;
         delete[] nodes;
+        
+        for(int i=0;i<n_nodes;i++)
+          delete[] edges[i];
         delete[] edges;
       }
     //private:
index b4e04c3363d05d476033ba386f0d6289238b8dd3..20e622c31fdb2a5352fabbb718e91bef9ecd1843 100644 (file)
@@ -385,6 +385,8 @@ void TopoLB::initDataStructures(CentralLB::LDStats *stats,int count,int *newmap)
       }
     }
   }
+  /*****FIXED A MEMORY LEAK******/
+  delete[] multicastAdded;
 
   /***************************/
   //Just a test
@@ -693,7 +695,9 @@ void TopoLB::performMapping(int *newmap, int count)
 #endif
     
   }
-  
+  /****FIXED a memory leak******/
+  delete [] distnew;
   /******************  Fill out final composition Mapping **************************/
 
 }