2007 Jun 09 - Sat
Memory Leak Detection in Visual Studio 2005 C++ Applications
In some recent software development, when working with C++ in Visual Studio 2005, when
ending a program which was run in the debugger, I'll sometimes get statements regarding
memory leaks.
Each memory leak has a unique number associated with it. If these leaks and their
numbers are repeatable, they can be tracked in Visual Studio by using the
'_CrtSetBreakAlloc' call in your code.
In your code, near the beginning of execution, place the call, using the leak number as a
parameter. This effectively creates a break point on the specific memory allocation call.
When your code allocates the memory allocation, the break point will allow you to inspect
the code and figure out why an appropriate dispose was not provided.
[/Personal/SoftwareDevelopment]
permanent link
|