Commit 4764243a authored by Mikaël Salson's avatar Mikaël Salson

algo: Solve memory leaks

Some allocations were not properly free-ed.
Spotted by Valgrind.

See #3031
parent 4b465dc6
......@@ -128,6 +128,7 @@ int main(int argc, char* argv[])
}
}
delete [] align_str;
}
}
......
......@@ -21,6 +21,16 @@ LazyMsa::LazyMsa(int max, string reference)
LazyMsa::~LazyMsa()
{
for (int i = 0; i <= sizeUsed; i++) {
delete [] gapRef[i];
delete [] gapSeq[i];
delete [] link[i];
}
delete [] gapRef;
delete [] gapSeq;
delete [] link;
delete [] sequences;
}
void LazyMsa::add(string sequence){
......@@ -127,6 +137,8 @@ void LazyMsa::align(string *align){
align[i+1]=stream2.str();
}
delete [] maxGap;
}
......
......@@ -1019,7 +1019,7 @@ int main (int argc, char **argv)
cout << " " << key << " " << it->second.name << endl ;
}
delete index;
delete multigermline;
exit(0);
}
......@@ -1583,6 +1583,8 @@ int main (int argc, char **argv)
delete out_segmented;
if (output_unsegmented)
delete out_unsegmented;
if (output_affects)
delete out_affects;
if (output_unsegmented_detail)
for (int i=STATS_FIRST_UNSEG; i<STATS_SIZE; i++)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment