Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualQanael

Posted 12 November 2012 - 08:40 PM

This is an interesting problem with static variables. Since you call CrtDumpMemoryLeaks() before main() exits, static variables which allocate memory (which get destructed after main() exits) will still show as memory leaks. To avoid this false positive, don't call CrtDumpMemoryLeaks() manually. The _CRTDBG_LEAK_CHECK_DF flag effectively adds the memory leak dump as an atexit() call, which happens at the very end of the program.

#5Qanael

Posted 12 November 2012 - 08:40 PM

This is an interesting problem with static variables. Since you call CrtDumpMemoryLeaks() before main() exits, static variables which allocate memory (which get destructed after main() exits) will still show as memory leaks. To avoid this false positive, don't call CrtDumpMemoryLeaks() manually. The _CRTDBG_LEAK_CHECK_DF flag effectively adds the memory leak dump as an atexit() call, which happens at the very end of the program.

#4Qanael

Posted 12 November 2012 - 08:40 PM

This is an interesting problem with static variables. Since you call CrtDumpMemoryLeaks() before main() exits, static variables which allocate memory (which get destructed after main() exits) will still show as memory leaks. To avoid this false positive, don't call CrtDumpMemoryLeaks() manually. The _CRTDBG_LEAK_CHECK_DF flag effectively adds the memory leak dump as an atexit() call, which happens at the very end of the program.

#3Qanael

Posted 12 November 2012 - 08:40 PM

This is an interesting problem with static variables. Since you call CrtDumpMemoryLeaks() before main() exits, static variables which allocate memory (which get destructed after main() exits) will still show as memory leaks. To avoid this false positive, don't call CrtDumpMemoryLeaks() manually. The _CRTDBG_LEAK_CHECK_DF flag effectively adds the memory leak dump as an atexit() call, which happens at the very end of the program.

#2Qanael

Posted 12 November 2012 - 08:39 PM

This is an interesting problem with static variables. Since you call CrtDumpMemoryLeaks() before main() exits, static variables which allocate memory (which get destructed after main() exits) will still show as memory leaks. To avoid this false positive, add _CRTDBG_LEAK_CHECK_DF to your CrtSetDbgFlag call, and don't call CrtDumpMemoryLeaks() manually. This effectively adds the memory leak dump as an atexit() call, which happens at the very end of the program.

#1Qanael

Posted 12 November 2012 - 08:39 PM

This is an interesting problem with static variables. Since you call CrtDumpMemoryLeaks() before main() exits, static variables which allocate memory (which get destructed after main() exits) will still show as memory leaks. To avoid this false positive, add _CRTDBG_LEAK_CHECK_DF to your CrtSetDbgFlag call, and don't call CrtDumpMemoryLeaks() manually.

PARTNERS