X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=readotu.cpp;h=98a63f05cdbea47c62c9dc07d7fd8c65dec35319;hb=7837a9bfdfccdc26360987a44c389832fdb82651;hp=d16dab9477d4c02ce89ad42de0be4c46228588b4;hpb=510b1cfc25cd79391d6973ca20c5ec25fb1bb3b2;p=mothur.git diff --git a/readotu.cpp b/readotu.cpp index d16dab9..98a63f0 100644 --- a/readotu.cpp +++ b/readotu.cpp @@ -12,7 +12,7 @@ /***********************************************************************/ ReadOTUFile::ReadOTUFile(string pf): philFile(pf){ - + m = MothurOut::getInstance(); //openInputFile(philFile, fileHandle); } @@ -35,20 +35,25 @@ void ReadOTUFile::read(GlobalData* globaldata){ //memory leak prevention //if (globaldata->ginput != NULL) { delete globaldata->ginput; } globaldata->ginput = input; //saving to be used by collector and rarefact commands. - + if ((globaldata->getFormat() == "list") || (globaldata->getFormat() == "rabund") || (globaldata->getFormat() == "sabund")) {//you are reading a list, rabund or sabund file for collect, rarefaction or summary. + +//cout << input << '\t' << globaldata << endl; order = input->getOrderVector(); //memory leak prevention + //if (globaldata->gorder != NULL) { delete globaldata->gorder; } globaldata->gorder = order; //saving to be used by collect and rarefact commands. sabund = inputSabund->getSAbundVector(); //if (globaldata->sabund != NULL) { delete globaldata->sabund; } globaldata->sabund = sabund; //saving to be used by summary command. delete inputSabund; + rabund = inputRabund->getRAbundVector(); //if (globaldata->rabund != NULL) { delete globaldata->rabund; } globaldata->rabund = rabund; //saving to be used by heatmap.bin command. delete inputRabund; + list = inputList->getListVector(); //if (globaldata->gListVector != NULL) { delete globaldata->gListVector; } globaldata->gListVector = list; @@ -59,10 +64,13 @@ void ReadOTUFile::read(GlobalData* globaldata){ //memory leak prevention //if (globaldata->gSharedList != NULL) { delete globaldata->gSharedList; } globaldata->gSharedList = SharedList; + delete inputSabund; + delete inputRabund; + delete inputList; } } catch(exception& e) { - errorOut(e, "ReadOTUFile", "read"); + m->errorOut(e, "ReadOTUFile", "read"); exit(1); } }