Postpone leak check so that global destructors can run first

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7213 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2020-08-11 22:52:25 +00:00
parent d18c26eea5
commit ddd40d4397

View file

@ -685,7 +685,8 @@ int _tmain(int argc, TCHAR **argv)
{
#ifndef NDEBUG
#ifdef _MSC_VER
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_CHECK_ALWAYS_DF);
const int dbgchkthorough = true, checkeveryallocfree = dbgchkthorough ? _CRTDBG_CHECK_ALWAYS_DF : 0;
_CrtSetDbgFlag(_CrtSetDbgFlag(_CRTDBG_REPORT_FLAG) | _CRTDBG_ALLOC_MEM_DF | checkeveryallocfree | _CRTDBG_LEAK_CHECK_DF);
_CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE), _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
_CrtSetReportMode(_CRT_ERROR, _CRTDBG_MODE_FILE), _CrtSetReportFile(_CRT_ERROR, _CRTDBG_FILE_STDOUT);
//_CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE), _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDOUT);
@ -694,7 +695,6 @@ int _tmain(int argc, TCHAR **argv)
int retval = makensismain(argc,argv);
#ifndef NDEBUG
#ifdef _MSC_VER
_CrtDumpMemoryLeaks();
assert(_CrtCheckMemory());
#endif
#endif