mirror of
https://github.com/reactos/reactos.git
synced 2025-06-16 02:58:30 +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 <shlobj.h>
|
||||||
#include <strsafe.h>
|
#include <strsafe.h>
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#include <crtdbg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
NOTEPAD_GLOBALS Globals;
|
NOTEPAD_GLOBALS Globals;
|
||||||
static ATOM aFINDMSGSTRING;
|
static ATOM aFINDMSGSTRING;
|
||||||
|
|
||||||
|
@ -565,10 +569,14 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE prev, LPTSTR cmdline, int sh
|
||||||
MONITORINFO info;
|
MONITORINFO info;
|
||||||
INT x, y;
|
INT x, y;
|
||||||
RECT rcIntersect;
|
RECT rcIntersect;
|
||||||
|
|
||||||
static const TCHAR className[] = _T("Notepad");
|
static const TCHAR className[] = _T("Notepad");
|
||||||
static const TCHAR winName[] = _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())
|
switch (GetUserDefaultUILanguage())
|
||||||
{
|
{
|
||||||
case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
|
case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue