This project has moved. For the latest updates, please go here.

VLDGetLeaksCount() is not equal to report leak count!

Jul 28, 2012 at 10:59 AM

Hi

VLDGetLeaksCount() return me 16 but output report file show me no memory leaks! :

No memory leaks detected.
Visual Leak Detector is now exiting.

 

I'm calling in end of my main() function, same as following pseudo code:

void WinMain()
{

 ...

cout<<VLDGetLeaksCount();
 return;
}

If i use VLDMarkAllLeaksAsReported(); in first of my main() function such as below, the VLDGetLeaksCount() return 2 and also log file show no memory leaks!

 

void WinMain()
{

VLDGetLeaksCount();
 ...

cout<<VLDGetLeaksCount();
 return;
}

How can i detect that is there any leaks or not before ending my application!? i want if there is any leak report to executer.

Thank you for any help.

H.Ahmadi

Coordinator
Jul 28, 2012 at 1:27 PM
I think this because some static variables freed after you call VLDGetLeakCount(). You should save leaks count at main() start and extract this count from second VLDGetLeakCount() call.

28.07.2012, в 13:59, Ahmadi <notifications@codeplex.com> написал(а):

From: Ahmadi

Hi

VLDGetLeaksCount() return me 16 but output report file show me no memory leaks! :

No memory leaks detected.
Visual Leak Detector is now exiting.

I'm calling in end of my main() function, same as following pseudo code:

void WinMain()
{

 ...

cout<<VLDGetLeaksCount();
 return;
}

If i use VLDMarkAllLeaksAsReported(); in first of my main() function such as below, the VLDGetLeaksCount() return 2 and also log file show no memory leaks!

void WinMain()
{

VLDGetLeaksCount();
 ...

cout<<VLDGetLeaksCount();
 return;
}

How can i detect that is there any leaks or not before ending my application!? i want if there is any leak report to executer.

Thank you for any help.

H.Ahmadi