mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-24 14:22:40 -06:00
In Win32, Ctrl-C on console app does not do leaks check anymore
This commit is contained in:
parent
79fe8271b0
commit
462587fb49
2 changed files with 17 additions and 1 deletions
|
|
@ -531,6 +531,16 @@ void AppInit__(int argc, const char **argv, const char **envptr)
|
|||
|
||||
#if defined(PLATFORM_WIN32)
|
||||
|
||||
#ifdef _DEBUG
|
||||
static BOOL WINAPI s_consoleCtrlHandler(DWORD signal) {
|
||||
if(signal == CTRL_C_EVENT) {
|
||||
extern bool NoMemoryLeaksCheck;
|
||||
NoMemoryLeaksCheck = true;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
void AppInitEnvironment__()
|
||||
{
|
||||
SetLanguage(LNG_('E', 'N', 'U', 'S'));
|
||||
|
|
@ -567,6 +577,10 @@ void AppInitEnvironment__()
|
|||
void AppInit__(int argc, const char **argv)
|
||||
{
|
||||
AppInitEnvironment__();
|
||||
|
||||
#ifdef _DEBUG
|
||||
SetConsoleCtrlHandler(s_consoleCtrlHandler, TRUE);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -225,9 +225,11 @@ void MemoryCheckDebug()
|
|||
while(p != &dbg_live);
|
||||
}
|
||||
|
||||
bool NoMemoryLeaksCheck;
|
||||
|
||||
void MemoryDumpLeaks()
|
||||
{
|
||||
if(PanicMode)
|
||||
if(PanicMode || NoMemoryLeaksCheck)
|
||||
return;
|
||||
#ifdef PLATFORM_MACOS
|
||||
return; // ignore leaks in macos
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue