]> git.donarmstrong.com Git - mothur.git/blobdiff - heatmapcommand.cpp
speed up rarefaction.shared
[mothur.git] / heatmapcommand.cpp
index fd7a8279e689b8226b2939ac8a07656dd290d530..09dfb5a15bde8e52a967c1ef9cdae0e4130a0b3a 100644 (file)
@@ -66,7 +66,10 @@ int HeatMapCommand::execute(){
                                        cout << lookup[0]->getLabel() << '\t' << count << endl;
                                        heatmap->getPic(lookup);
                                }
-                                               
+                               
+                               //prevent memory leak
+                               for (int i = 0; i < lookup.size(); i++) {  delete lookup[i];  }
+                               
                                //get next line to process
                                lookup = input->getSharedRAbundVectors();                               
                                count++;
@@ -85,6 +88,7 @@ int HeatMapCommand::execute(){
                                        heatmap->getPic(rabund);
                                }
                                
+                               delete rabund;
                                rabund = input->getRAbundVector();
                                count++;
                        }