]> git.donarmstrong.com Git - mothur.git/blobdiff - summarycommand.cpp
fixed some bugs
[mothur.git] / summarycommand.cpp
index fa6d11ade6a27c69655e4b383b37f27f4a87f3bc..ee4ba9f760c656f84cbe13da9ed6da0cccb73e60 100644 (file)
@@ -194,10 +194,12 @@ void SummaryCommand::help(){
 //**********************************************************************************************************************
 
 SummaryCommand::~SummaryCommand(){
-       delete sabund;
-       delete input;
-       delete read;
-       delete validCalculator;
+       if (abort == false) {
+               delete input;  globaldata->ginput = NULL;
+               delete read;
+               delete validCalculator;
+               globaldata->sabund = NULL;
+       }
 }
 
 //**********************************************************************************************************************
@@ -272,7 +274,7 @@ int SummaryCommand::execute(){
                                outputFileHandle << endl;
                        }               
 
-                       if (count != 1) { delete lastSAbund; }
+                       if (count != 1) { delete lastSAbund;  }
                        lastSAbund = sabund;                    
 
                        sabund = input->getSAbundVector();
@@ -304,6 +306,8 @@ int SummaryCommand::execute(){
                        outputFileHandle << endl;
                }
                
+               outputFileHandle.close();
+               
                delete lastSAbund;
                return 0;
        }