mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[NOTEPAD] Use _CrtSetDbgFlag to check memory leak (#5151)
We can borrow the power of CRT debug. These changes are effective for debug version only: - Insert #include <crtdbg.h> at main.c. - Call _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF) at the prologue of _tWinMain. CORE-18837
This commit is contained in:
parent
c766ee9ebb
commit
9abd9b667a
1 changed files with 9 additions and 1 deletions
|
@ -27,6 +27,10 @@
|
|||
#include <shlobj.h>
|
||||
#include <strsafe.h>
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
NOTEPAD_GLOBALS Globals;
|
||||
static ATOM aFINDMSGSTRING;
|
||||
|
||||
|
@ -565,10 +569,14 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE prev, LPTSTR cmdline, int sh
|
|||
MONITORINFO info;
|
||||
INT x, y;
|
||||
RECT rcIntersect;
|
||||
|
||||
static const TCHAR className[] = _T("Notepad");
|
||||
static const TCHAR winName[] = _T("Notepad");
|
||||
|
||||
#ifdef _DEBUG
|
||||
/* Report any memory leaks on exit */
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
switch (GetUserDefaultUILanguage())
|
||||
{
|
||||
case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
|
||||
|
|
Loading…
Reference in a new issue