mirror of
https://github.com/reactos/reactos.git
synced 2025-07-05 04:31:22 +00:00
[MSPAINT] 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.cpp.
- Call _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF) at the prologue of _tWinMain.
This is a follow-up of #5151 (9abd9b6
).
CORE-18867
This commit is contained in:
parent
9abd9b667a
commit
0998665463
1 changed files with 9 additions and 2 deletions
|
@ -6,10 +6,12 @@
|
||||||
* PROGRAMMERS: Benedikt Freisen
|
* PROGRAMMERS: Benedikt Freisen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* INCLUDES *********************************************************/
|
|
||||||
|
|
||||||
#include "precomp.h"
|
#include "precomp.h"
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
#include <crtdbg.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/* FUNCTIONS ********************************************************/
|
/* FUNCTIONS ********************************************************/
|
||||||
|
|
||||||
POINT start;
|
POINT start;
|
||||||
|
@ -159,6 +161,11 @@ _tWinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPTSTR lpszArgument
|
||||||
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff
|
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
/* Report any memory leaks on exit */
|
||||||
|
_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* init font for text tool */
|
/* init font for text tool */
|
||||||
ZeroMemory(&lfTextFont, sizeof(lfTextFont));
|
ZeroMemory(&lfTextFont, sizeof(lfTextFont));
|
||||||
lfTextFont.lfHeight = 0;
|
lfTextFont.lfHeight = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue