I am a bit new to using Visual Studio 2013 and am trying to get Visual Leak Detector (Version 2.3) working so that I can check my projects for memory leaks.
I've got it installed and have added C:\Program Files (x86)\Visual Leak Detector\include to my include directories
and C:\Program Files (x86)\Visual Leak Detector\lib\Win32 to my library directories (both for debug mode).
I build and run the following simple program using the debug menu (or hitting f5):
#include <iostream>
#include <vld.h> //visual leak detector
using namespace std;
int main()
{
for (int i = 0; i < 1000000; i++)
int *ptr = new int(100);
return 0;
}
The leak is obvious (and intentional) here, to test the functionality, but this is the report I get back:
Visual Leak Detector Version 2.3 installed.
The thread 0x38ac has exited with code 0 (0x0).
No memory leaks detected.
Visual Leak Detector is now exiting.
The program '[8136] Test.exe' has exited with code 0 (0x0).
Any ideas?
Edit: I should point out that adding
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
To the beginning of my code and
_CrtDumpMemoryLeaks();
right before the end of main(), does in fact cause Visual Studio's built in leak detection to report leaks, however Visual leak detector still follows this report by saying No memory leaks detected and providing no information.