diff --git a/base/applications/taskmgr/precomp.h b/base/applications/taskmgr/precomp.h index 5593f401fcd..872cc76d0ae 100644 --- a/base/applications/taskmgr/precomp.h +++ b/base/applications/taskmgr/precomp.h @@ -9,6 +9,11 @@ #include #include +#ifdef _DEBUG + #define _CRTDBG_MAP_ALLOC + #include +#endif + #define WIN32_NO_STATUS #include diff --git a/base/applications/taskmgr/taskmgr.c b/base/applications/taskmgr/taskmgr.c index 1c754858efa..197b6f82e62 100644 --- a/base/applications/taskmgr/taskmgr.c +++ b/base/applications/taskmgr/taskmgr.c @@ -116,6 +116,11 @@ int APIENTRY wWinMain(HINSTANCE hInstance, TOKEN_PRIVILEGES tkp; HANDLE hMutex; +#ifdef _DEBUG + // Report any memory leaks on exit + _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); +#endif + /* check wether we're already running or not */ hMutex = CreateMutexW(NULL, TRUE, L"taskmgrros"); if (hMutex && GetLastError() == ERROR_ALREADY_EXISTS)