No Leaks Detected in CLR application (vs 2010)

Jan 2, 2014 at 8:29 AM
Edited Jan 2, 2014 at 8:58 AM
It is easy to reproduce. Just create a new project, choose 'CLR Console Application' from the templates and add a leak, something like
#include "vld.h"

int main(array<System::String ^> ^args)
{
    int* thisShouldLeak = new int(5);
    return 0;
}
The output will be
No memory leaks detected.
Visual Leak Detector is now exiting.
Jan 2, 2014 at 9:10 AM
Another interesting repro is this:
Create a new project using the 'MFC Application' template, and add a leak somewhere (say in the InitInstance) like
BOOL CSimpleMfcAppApp::InitInstance()
{
        int* thisShouldLeak = new int(5);
        ...
As expected, this gets reported by both the default leak detection and by vld if enabled.

Now go on project properties and change the 'Common Language Runtime Support' option from 'No Common Language Runtime Support' to 'Common Language Runtime Support (/clr)'

The builtin leak detection will still report the leak.
But if you enable vld (by adding #include "vld.h") you will have a sad
No memory leaks detected.
Visual Leak Detector is now exiting.
Let me know if there is anything I can do to help fixing this