Commit ac3ea649 authored by Mathieu Giraud's avatar Mathieu Giraud

core/germline.cpp: delete only once the index when it is shared between several germlines

parent 6fa07171
......@@ -140,9 +140,18 @@ MultiGermline::MultiGermline(bool _one_index_per_germline)
}
MultiGermline::~MultiGermline() {
bool first = true ;
for (list<Germline*>::const_iterator it = germlines.begin(); it != germlines.end(); ++it)
{
if (!one_index_per_germline && !first)
{
// The index was already deleted in the first germline
(*it) -> index = 0 ;
}
delete *it ;
first = false ;
}
}
......
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