Visual Studio Memory Leak Detector
Posted: Sun Jan 06, 2013 8:16 pm
Visual Leak Detector
http://vld.codeplex.com/
Literally the easiest thing I've ever used. You reference the lib, include the header and when you exit the application it spits a memory allocation report to the Output window.
When it detects an allocation that was never freed it gives you the call stack at the time of allocation, which includes the file name and line number. For example:
http://vld.codeplex.com/
Literally the easiest thing I've ever used. You reference the lib, include the header and when you exit the application it spits a memory allocation report to the Output window.
When it detects an allocation that was never freed it gives you the call stack at the time of allocation, which includes the file name and line number. For example:
I look at line 29 in Spritesheet.cpp and find:Call Stack:
spritesheet.cpp (29): ProjectGenesis.exe!Spritesheet::Spritesheet + 0x7 bytes
renderengine.cpp (129): ProjectGenesis.exe!RenderEngine::LoadSpritesheetCB + 0x42 bytes
sqlite3.c (90614): ProjectGenesis.exe!sqlite3_exec + 0x15 bytes
renderengine.cpp (143): ProjectGenesis.exe!RenderEngine::LoadSpritesheet + 0x1C bytes
level.cpp (53): ProjectGenesis.exe!Level::Level + 0x12 bytes
gameengine.cpp (189): ProjectGenesis.exe!GameEngine::LoadLevel + 0x2F bytes
main.cpp (83): ProjectGenesis.exe!main + 0x26 bytes
frameRect = new sf::IntRect();I add the cleanup code I forgot in Spritesheet::~Spritesheet():
delete frameRect;No more memory leak.