Using AfxEnableMemoryTracking to Detect Memory Leaks

Has anyone personally used

AfxEnableMemoryTracking feature provided by MFC

to detect memory leaks. How useful is this?

+3
source share
1 answer

Memory tracking is enabled by default in MFC Debug builds. AfxEnableMemoryTracking is mainly used to temporarily disable memory tracking in some code snippets, if necessary. To use the MFC built-in memory leak detection, make sure that each .cpp file contains the following code after all #include lines:

#ifdef _DEBUG
#define new DEBUG_NEW 
#endif
+4
source

Source: https://habr.com/ru/post/1759334/


All Articles