Game Object Factory: Fixing Memory Leaks
- by Bunkai.Satori
Dear all, this is going to be tough: I have created a game object factory that generates objects of my wish. However, I get memory leaks which I can not fix.
Memory leaks are generated by return new Object(); in the bottom part of the code sample.
static BaseObject * CreateObjectFunc()
{
return new Object();
}
How and where to delete the…