It seems whenever there are static objects, _CrtDumpMemoryLeaks returns a false positive claiming it is leaking memory. I know this is because they do not get destroyed unti
Ach. If you are sure that _CrtDumpMemoryLeaks()
is lying, then you are probably correct. Most alleged memory leaks that I see are down to incorect calls to _CrtDumpMemoryLeaks()
. I agree entirely with the following; _CrtDumpMemoryLeaks()
dumps all open handles. But your program probably already has open handles, so be sure to call _CrtDumpMemoryLeaks()
only when all handles have been released. See http://www.scottleckie.com/2010/08/_crtdumpmemoryleaks-and-related-fun/ for more info.