c++visual-studio-2010memory-leaksmemory-leak-detectorvisual-leak-detector

Visual Leak Detector does not work


I have just started using Visual Leak Detector for Visual C++ 2008/2010

When i run it on small app (just few line with undeleted allocations) it works just fine.

Now I want to run it into my bigger app (wxWidgets app, 2 threads), but when I include

#include <vld.h>

my app does not completely start up. It starts cycling when Gui is created. Somethimes app load completely, but again, stuck when I for example press some button...

When I hit pause button, to see which code is being processed I see just

stack: ntdll, kernel...

Is anybody run into similar problem?

Is there any way to make it work?


Solution

  • Visual Leak Detector makes the App run VERY slowly, be patient.

    Are you running a single binary file?

    I'v had issues when my program was split into the main executable and libraries loaded on the run.

    The solution was to do the #include everywhere, especially the executable.

    Note that you can use VLDDisable and VLDEnable if you want to target specific parts of the code, note that these work per thread. Disabling in one thread doesn't modify what goes on in others.