Open rhymu8354 opened 4 years ago
For example, in Windows, Microsoft CRT functions can detect memory leaks like this:
#ifdef _WIN32 #include <crtdbg.h> #endif /* _WIN32 */ int main(int argc, char* argv[]) { // Set up to catch memory leaks. #ifdef _WIN32 //_crtBreakAlloc = 18; _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif /* _WIN32 */
Neui recommendation:
"[13:20] Neui: For memory leaks I also suggested DrMemory and LeakSanitizer"
For example, in Windows, Microsoft CRT functions can detect memory leaks like this: