Friday, August 9, 2013

A tool for searching for memory leaks



1. Download and install utility from http://vld.codeplex.com  (it's free).
2. In VS invoke dialog Tools -> Options..., select page Projects and Solutions -> VC++ Directories and add 
C:\Program Files (x86)\Visual Leak Detector\include 
to the list of Include files, and 
C:\Program Files (x86)\Visual Leak Detector\lib\Win32
to Library files.
3. Restart Visual Studio.
4. In any project file, add line 
#include "vld.h".
5. Build the project and run from the debugger.
6. After exiting the program, Output window will contain additional information about some (but unfortunately not all) of memory leaks, which makes it easy to locate them.
7. Please don't forget to remove #include "vld.h" before committing :)

by Oleg.B

No comments:

Post a Comment