https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9a51c8e6c6f01c42ec34c2b4ec46fa7abb4051fb

commit 9a51c8e6c6f01c42ec34c2b4ec46fa7abb4051fb
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Thu Oct 12 22:53:02 2023 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Thu Oct 12 22:53:02 2023 +0900

    [MSPAINT][NOTEPAD][REGEDIT] Don't use CRTDBG for these apps (#5788)
    
    Don't include <crtdbg.h>.
    Don't use _CrtSetDbgFlag.
---
 base/applications/mspaint/main.cpp  | 5 -----
 base/applications/mspaint/precomp.h | 4 ----
 base/applications/notepad/main.c    | 5 -----
 base/applications/notepad/notepad.h | 4 ----
 base/applications/regedit/main.c    | 5 -----
 base/applications/regedit/regedit.h | 4 ----
 6 files changed, 27 deletions(-)

diff --git a/base/applications/mspaint/main.cpp 
b/base/applications/mspaint/main.cpp
index dda9db7618e..7357bb134cb 100644
--- a/base/applications/mspaint/main.cpp
+++ b/base/applications/mspaint/main.cpp
@@ -299,11 +299,6 @@ HWND CMainWindow::DoCreate()
 INT WINAPI
 _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, INT 
nCmdShow)
 {
-#ifdef _DEBUG
-    // Report any memory leaks on exit
-    _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
-#endif
-
     g_hinstExe = hInstance;
 
     // Initialize common controls library
diff --git a/base/applications/mspaint/precomp.h 
b/base/applications/mspaint/precomp.h
index 09775b0cb72..a24f1a3b654 100644
--- a/base/applications/mspaint/precomp.h
+++ b/base/applications/mspaint/precomp.h
@@ -26,10 +26,6 @@
 #include <shellapi.h>
 #include <htmlhelp.h>
 #include "atlimagedx.h"
-#ifdef _DEBUG
-    #define _CRTDBG_MAP_ALLOC
-    #include <crtdbg.h>
-#endif
 
 #include <debug.h>
 
diff --git a/base/applications/notepad/main.c b/base/applications/notepad/main.c
index 77100a2e26a..85cd029610c 100644
--- a/base/applications/notepad/main.c
+++ b/base/applications/notepad/main.c
@@ -564,11 +564,6 @@ int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE prev, 
LPTSTR cmdline, int sh
     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):
diff --git a/base/applications/notepad/notepad.h 
b/base/applications/notepad/notepad.h
index b369101da5f..494fd8ba1ba 100644
--- a/base/applications/notepad/notepad.h
+++ b/base/applications/notepad/notepad.h
@@ -25,10 +25,6 @@
 #include <tchar.h>
 #include <stdlib.h>
 #include <malloc.h>
-#ifdef _DEBUG
-    #define _CRTDBG_MAP_ALLOC
-    #include <crtdbg.h>
-#endif
 
 #include "dialog.h"
 #include "notepad_res.h"
diff --git a/base/applications/regedit/main.c b/base/applications/regedit/main.c
index 3f58f0162e9..c762d6521dd 100644
--- a/base/applications/regedit/main.c
+++ b/base/applications/regedit/main.c
@@ -205,11 +205,6 @@ 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));
diff --git a/base/applications/regedit/regedit.h 
b/base/applications/regedit/regedit.h
index 102f3480524..8fbfd9c99b4 100644
--- a/base/applications/regedit/regedit.h
+++ b/base/applications/regedit/regedit.h
@@ -11,10 +11,6 @@
 #include <shellapi.h>
 #include <strsafe.h>
 #include <stdlib.h>
-#ifdef _DEBUG
-    #define _CRTDBG_MAP_ALLOC
-    #include <crtdbg.h>
-#endif
 
 #include "main.h"
 #include "hexedit.h"

Reply via email to