]> git.donarmstrong.com Git - mothur.git/blobdiff - collect.cpp
fixed memory leak in rarefact
[mothur.git] / collect.cpp
index ee46ef5928d8be156af4e1875304b633539e5147..76481d1739c2f652b60028c592aabe18d3d54736 100644 (file)
@@ -46,6 +46,10 @@ void Collect::getCurve(int increment = 1){
                 for(int i=0;i<displays.size();i++){
                         displays[i]->reset();
                 }
+                               
+                               delete lookup;
+                               delete rank;
+                               delete ccd;
         }
         catch(exception& e) {
                 cout << "Standard Error: " << e.what() << " has occurred in the Collect class Function getCurve. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
@@ -151,6 +155,13 @@ try {
                 for(int i=0;i<displays.size();i++){
                         displays[i]->reset();
                 }
+                               
+                               //memory cleanup
+                               delete ccd;
+                               for (int i = 0; i < lookup.size(); i++) {
+                                       delete lookup[i];
+                               }
+
         }
         catch(exception& e) {
                 cout << "Standard Error: " << e.what() << " has occurred in the Collect class Function getSharedCurve. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";