My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 10: Memory leak using vectors
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  dpull...@me.com
Closed:  Feb 2012


 
Project Member Reported by dpull...@me.com, Feb 11, 2012
When we switched our solution to using vectors instead of link lists, we did not know how to delete vectors from the heap.  As we predicted, we had a huge memory leak.  The good new is our algoritm works, we just need to figure out a way to solve our memory problem.

UNRESOLVED
Feb 11, 2012
Project Member #1 tcstewar...@gmail.com
Everything is fixed! It seems the issue was that we were deleting allocated memory twice. To be specific, in the Round::run function, when moving the ballots around between candidates, we were not really "moving" them. We were copying them to the other candidates, failing to clear the ballots of losing candidate. Later, when delete was called, it was trying to delete not only the ballots in the losing candidates, but also the same ballots (same pointer) that were located in other candidates. The problem has been resolved using the vector::erase function to clear the unused candidates ballot vectors. 


Feb 11, 2012
Project Member #2 tcstewar...@gmail.com
(No comment was entered for this change.)
Status: Fixed

Powered by Google Project Hosting