I am following msdn article for finding memory leaks using CRT.
http://msdn.microsoft.com/en-us/library/x98tx3cf%28v=vs.100%29.aspx
I added _CrtDumpMemoryLeaks(); to the exit point of my application. It shows me thousands of memory leaks in different files. But I am interested in finding memory leaks of a particular file/class/function. Is there any possible way to implement this.
Here is what I tried to do.
void SomeClass::SomeRandomFunction(SomeRandomParameters)
{
_CrtDumpMemoryLeaks(); // Start of function.
// Some lines of codes which may contain memory leaks.
_CrtDumpMemoryLeaks(); // End of function.
}
I added breakpoints on entry and exit of this method. I thought that second DumpMemory function will display only memory leaks which were find between these two DumpMemory function calls. But it didn't happened. Is there any other way to do this?