mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[REGEDIT] Use _CrtSetDbgFlag to check memory leak
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 wWinMain. This is a follow-up of #5151 (9abd9b6
) and0998665
.
This commit is contained in:
parent
0998665463
commit
5cf947edc7
1 changed files with 9 additions and 0 deletions
|
@ -20,6 +20,10 @@
|
|||
|
||||
#include "regedit.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
BOOL ProcessCmdLine(WCHAR *cmdline);
|
||||
|
||||
const WCHAR *reg_class_namesW[] = {L"HKEY_LOCAL_MACHINE", L"HKEY_USERS",
|
||||
|
@ -205,6 +209,11 @@ int WINAPI wWinMain(HINSTANCE hInstance,
|
|||
|
||||
UNREFERENCED_PARAMETER(hPrevInstance);
|
||||
|
||||
#ifdef _DEBUG
|
||||
/* Report any memory leaks on exit */
|
||||
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||
#endif
|
||||
|
||||
/* Initialize global strings */
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, ARRAY_SIZE(szTitle));
|
||||
LoadStringW(hInstance, IDC_REGEDIT_FRAME, szFrameClass, ARRAY_SIZE(szFrameClass));
|
||||
|
|
Loading…
Reference in a new issue