]> git.donarmstrong.com Git - mothur.git/commitdiff
fixed memory leak in collect.shared()
authorwestcott <westcott>
Fri, 15 May 2009 14:39:11 +0000 (14:39 +0000)
committerwestcott <westcott>
Fri, 15 May 2009 14:39:11 +0000 (14:39 +0000)
collectsharedcommand.cpp
sharedjest.cpp
sharedsorest.cpp

index 4a3a338944958aa8e9342661847898c20e598f3d..0ac767ddc9cc1410352fd8f34701413d3359140b 100644 (file)
@@ -142,7 +142,7 @@ int CollectSharedCommand::execute(){
                util->updateGroupIndex(globaldata->Groups, globaldata->gGroupmap->groupIndex);
 
                while(order != NULL){
-               
+
                        orderList.insert(order->getLabel());
                        
                        if(globaldata->allLines == 1 || globaldata->lines.count(count) == 1 || globaldata->labels.count(order->getLabel()) == 1){
index a1b506eb131f4f96f89d865ef4f27072ab150c20..1ca64b438036d40e2e75e70cde735f8637a53c6b 100644 (file)
@@ -42,7 +42,13 @@ EstOutput Jest::getValues(vector<SharedRAbundVector*> shared) {
                data[0] = S12[0] / (float)(S1[0] + S2[0] - S12[0]);
                
                if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
-                
+               
+               delete sharedChao;
+               delete chaoS1;
+               delete chaoS2;
+               delete chaoS1Sabund;
+               delete chaoS2Sabund;
+               
                return data;
        }
        catch(exception& e) {
index 429308fc1e457fd469fd1b0eb005b356496a7880..91191d5e9ec85c7b8b1f918148c9a9dfba69fa44 100644 (file)
@@ -42,6 +42,12 @@ EstOutput SorEst::getValues(vector<SharedRAbundVector*> shared) {
                 
                if (isnan(data[0]) || isinf(data[0])) { data[0] = 0; }
                
+               delete sharedChao;
+               delete chaoS1;
+               delete chaoS2;
+               delete chaoS1Sabund;
+               delete chaoS2Sabund;
+               
                return data;
        }
        catch(exception& e) {