Every Game::EntitiesPtrs.pop_back(); call leaks an entity if you didn't delete first. Maybe not oodles, but ClearEntities() certainly leaks.
Can't find memory leak
Clearentities only pops if the pointer is a Null pointer, meaning the object was already removed with delete! ClearEntities() shouldn't leak anything. I always delete the Entities before popping. Also i doubt that the Entity class only takes 16 bytes of memory for each instance.
You're zeroing over constructed STL objects:
SecureZeroMemory(&this->entityData, sizeof(this->entityData));
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement