EGAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!
TTTHHHHHHHHHHHHHPPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA!!!!!!!!!!!!!!!
GOD I CAN'T FIND IT!!!
SOMEWHERE I have a memory leak, and I can't for the life of me track it down!
I'm working a bit on Squarediana Jones/SnakeEngine[Scarlet], and among one of them there is a very tiny memory leak, and it is driving me crazy!
Maybe I need better tools, but I don't know what.
Right now all I do is the lame bring up task manager and watch if memory usage goes up.
Once every few times I reload a level (the only level I currently have) memory usage goes up (4 - 8k).
I've tracked it down to when I create new Treasures and WhipHooks (they'll both do it).
Now I can't for the life of me find anything I'm newing and not deleting. I've tried using a giant picture for the sprite to see if that increases how much memory goes up, it doesn't change.
I've tried adding huge double arrays to the whiphooks/treasures themselves, doesn't change it (well, the initial memory usage is way higher, but the increase isn't changed).
I've tried adding huge double arrays to the sprite class, no change.
Basically all that I'm making are simple classes that have sprite classes. It's so simple I figured it would have to be in the Sprite class or Scarlet somewhere, but holy crap I don't know where.
Maybe adding giant arrays to things isn't the most elegant way of tracking down things like this, but I'm not sure what else to do...
So yeah, I'm at a loss
Do your classes have raw pointers to memory allocated with new? Do all such classes have proper copy/assignment operators which will free the old stuff, etc, as necessary? This is especially required with using STL stuff, which very commonly call the copy constructor to move your stuff around in memory.