Closed GoogleCodeExporter closed 9 years ago
Thanks for finding the leaks! Care to submit a patch?
Original comment by mason.gr...@gmail.com
on 13 Mar 2010 at 2:46
The CreateAdvancingFront leak seems to be a matter of dealing with this TODO in
Sweep::Fill() at sweep/sweep.cc line 210:
- // TODO: delete node from memory
- //tcx.RemoveNode(node);
+ tcx.RemoveNode(&node);
And then we have to avoid using the freed memory in Sweep::FillAdvancingFront()
line
230 and similarly at line 240. Partial workaround:
- Fill(tcx, *node);
- node = node->next;
+ Node *tmp = node;
+ node = node->next;
+ Fill(tcx, *tmp);
That works with 'dude.dat' but segfaults with some other tests like 'bird.dat'.
There are other pointers to the node being deleted... I don't have time to sort
it
all out now.
Original comment by tnove...@gmail.com
on 9 Apr 2010 at 3:27
The problem stems from NOT deleting nodes from memory after they are discarded
from
the advancing front. I know how to fix; it's just a matter of finding the time.
Original comment by mason.gr...@gmail.com
on 9 Apr 2010 at 3:31
Fixed memory leaks by manually deleting nodes in obvious places when they're no
longer
needed. There were still a few strays that I did not track down, although I
solved
this problem by simply stuffing all new nodes into a vector container. If
there's ever
a need for a non-STL version someone will need to spend a little extra time and
fix.
Original comment by mason.gr...@gmail.com
on 23 Apr 2010 at 5:24
Original issue reported on code.google.com by
Dimitris...@gmail.com
on 12 Mar 2010 at 6:35