Hiya.
I'm attempting to make an algorithm that can draw the entities of my isometric game in the correct order. My entities are stored in a vector of pointers.
In the drawing function I first create a new vector of the same pointers, and then start with a for-loop that loops the amount of entities that I want to have drawn. Inside that loop there is yet another loop, which determines what entity to be drawn, and when an entity is drawn it's pointer is removed from the vector using vector.erase(), so the same entity wont be drawn twice (Which is why I'm creating a copy of the vector that is containing the entity pointers).
Anyway, my code itself works, and the entities are drawn the way I want, but I appear to have a memory leak (I can actually see the memory in the Windows Task Manager climb by 28 kb/s).
The memory leak remains even if I outcomment everything except this:
vector<Entity*> list = ent_list; // ent_list is the list of entity pointers
list.clear();
So I guess I'm missing something, but I'm not sure what. I figured since I didn't use "new" the memory would be taken care of, but obviously it isn't... Hope someone can help me!
/feodor