Skip to content

Commit d0e51fb

Browse files
committed
Make use of Visual C++ runtime memory leak tracing
1 parent f71a4ad commit d0e51fb

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

cli/main.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ void CheckOther::checkZeroDivision()
108108
*/
109109
int main(int argc, char* argv[])
110110
{
111+
// MS Visual C++ memory leak debug tracing
112+
#if defined(_MSC_VER) && defined(_DEBUG)
113+
_CrtSetDbgFlag( _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG ) | _CRTDBG_LEAK_CHECK_DF);
114+
#endif
115+
111116
CppCheckExecutor exec;
112117
#ifdef _WIN32
113118
char exename[1024] = {0};

lib/config.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,10 @@
1313
# define CPPCHECKLIB
1414
#endif
1515

16+
// MS Visual C++ memory leak debug tracing
17+
#if defined(_MSC_VER) && defined(_DEBUG)
18+
# define _CRTDBG_MAP_ALLOC
19+
# include <crtdbg.h>
20+
#endif
21+
1622
#endif // configH

0 commit comments

Comments
 (0)