X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=parselistcommand.cpp;h=5de3b72daa63b962ff9be84b5665e7230fb2470b;hb=753dc84cf289b1d5dc0ca5b0c043640927aa951a;hp=c0622f219cc252be7ca0bf29d28ac349cddb3357;hpb=de2dc9fb831f569b823031d0730f5a0d739e8290;p=mothur.git diff --git a/parselistcommand.cpp b/parselistcommand.cpp index c0622f2..5de3b72 100644 --- a/parselistcommand.cpp +++ b/parselistcommand.cpp @@ -15,10 +15,8 @@ ParseListCommand::ParseListCommand(){ globaldata = GlobalData::getInstance(); //read in group map info. - groupMap = new GroupMap(globaldata->getGroupFile()); - groupMap->readMap(); + groupMap = globaldata->gGroupmap; - //fill filehandles with neccessary ofstreams int i; ofstream* temp; @@ -86,7 +84,6 @@ void ParseListCommand::parse(int index, SharedListVector* list) { int ParseListCommand::execute(){ try{ - globaldata = GlobalData::getInstance(); int count = 1; //read in listfile @@ -100,10 +97,6 @@ int ParseListCommand::execute(){ set processedLabels; set userLabels = globaldata->labels; set userLines = globaldata->lines; - - //read in group map info. - groupMap = new GroupMap(globaldata->getGroupFile()); - groupMap->readMap(); //create new list vectors to fill with parsed data for (int i=0; igetNumGroups(); i++) { @@ -163,6 +156,18 @@ int ParseListCommand::execute(){ if (globaldata->gGroupmap != NULL) { delete globaldata->gGroupmap; } globaldata->gGroupmap = groupMap; + //close files + for (it3 = filehandles.begin(); it3 != filehandles.end(); it3++) { + ofstream* temp = it3->second; + (*temp).close(); + delete it3->second; + } + + //delete list vectors to fill with parsed data + for (it2 = groupOfLists.begin(); it2 != groupOfLists.end(); it2++) { + delete it2->second; + } + return 0; } catch(exception& e) {