Hi, i want to do a class for debug my projects.
I would like know if anyone have done any type of class or code for debug theirs projects and know if the has leaks memory , of what use of memory it has
Anyone has a toolkit , classes,or snippet code for debug projects in builting
thanks
toolkit memory usage
Add these lines:
and these to the main function:This will cause to dump all memory leaks at the finish of program execution when in debug mode. Using function _CrtDumpMemoryLeaks(); you can dump them in any place in your code.
Code: Select all
#ifdef _DEBUG
#include "crtdbg.h"
#define new new(_NORMAL_BLOCK, __FILE__, __LINE__)
#endif
Code: Select all
#ifdef _DEBUG
int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
flag |= _CRTDBG_LEAK_CHECK_DF;
_CrtSetDbgFlag(flag);
#endif