From e81e076cbba02b37cd338370aaa32acaf1407c29 Mon Sep 17 00:00:00 2001 From: westcott Date: Fri, 15 May 2009 14:39:11 +0000 Subject: [PATCH] fixed memory leak in collect.shared() --- collectsharedcommand.cpp | 2 +- sharedjest.cpp | 8 +++++++- sharedsorest.cpp | 6 ++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/collectsharedcommand.cpp b/collectsharedcommand.cpp index 4a3a338..0ac767d 100644 --- a/collectsharedcommand.cpp +++ b/collectsharedcommand.cpp @@ -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){ diff --git a/sharedjest.cpp b/sharedjest.cpp index a1b506e..1ca64b4 100644 --- a/sharedjest.cpp +++ b/sharedjest.cpp @@ -42,7 +42,13 @@ EstOutput Jest::getValues(vector 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) { diff --git a/sharedsorest.cpp b/sharedsorest.cpp index 429308f..91191d5 100644 --- a/sharedsorest.cpp +++ b/sharedsorest.cpp @@ -42,6 +42,12 @@ EstOutput SorEst::getValues(vector 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) { -- 2.39.2