*/
#include "readdistcommand.h"
+#include "readphylip.h"
+#include "readcolumn.h"
+#include "readmatrix.hpp"
ReadDistCommand::ReadDistCommand(){
try {
else if (format == "matrix") {
groupMap = new GroupMap(globaldata->getGroupFile());
groupMap->readMap();
- if (globaldata->gGroupmap != NULL) { delete globaldata->gGroupmap; }
+ //if (globaldata->gGroupmap != NULL) { delete globaldata->gGroupmap; }
globaldata->gGroupmap = groupMap;
}
openInputFile(filename, in);
matrix = new FullMatrix(in); //reads the matrix file
//memory leak prevention
- if (globaldata->gMatrix != NULL) { delete globaldata->gMatrix; }
+ //if (globaldata->gMatrix != NULL) { delete globaldata->gMatrix; }
globaldata->gMatrix = matrix; //save matrix for coverage commands
}else {
read->read(nameMap);
+ //to prevent memory leak
+ if (globaldata->gListVector != NULL) { delete globaldata->gListVector; }
globaldata->gListVector = read->getListVector();
+ if (globaldata->gSparseMatrix != NULL) { delete globaldata->gSparseMatrix; }
globaldata->gSparseMatrix = read->getMatrix();
}
return 0;