diff options
Diffstat (limited to 'source/slangc/main.cpp')
| -rw-r--r-- | source/slangc/main.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/slangc/main.cpp b/source/slangc/main.cpp index 2907625ed..6e76e2f93 100644 --- a/source/slangc/main.cpp +++ b/source/slangc/main.cpp @@ -140,6 +140,7 @@ int wmain(int argc, wchar_t** argv) } #ifdef _MSC_VER + // _CrtXXX functions are functional only for debug build. The spec says, // "When _DEBUG isn't defined, calls to _CrtSetReportMode are removed // during preprocessing." _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); @@ -149,7 +150,9 @@ int wmain(int argc, wchar_t** argv) _CrtSetReportMode(_CRT_ASSERT, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG); _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR); - _CrtDumpMemoryLeaks(); + int memleakDetected = _CrtDumpMemoryLeaks(); + SLANG_UNUSED(memleakDetected); + assert(!memleakDetected); #endif return result; |
