minor fix (probably necessary for vc2002/3): only do leak reporting if mmgr.h thinks the debug allocator should be used (since that header is responsible for including the requisite crtdbg.h)

This was SVN commit r5390.
This commit is contained in:
janwas 2007-10-06 09:11:15 +00:00
parent ee0c58dbc2
commit 7dbc72ba3c

View File

@ -17,7 +17,7 @@ class LeakReporter : public CxxTest::GlobalFixture
// (This is done in tearDownWorld so that it doesn't report 'leaks'
// if the program is aborted before finishing cleanly.)
#ifdef _MSC_VER
#ifdef HAVE_VC_DEBUG_ALLOC
int flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
flags |= _CRTDBG_LEAK_CHECK_DF; // check for memory leaks
flags |= _CRTDBG_ALLOC_MEM_DF; // also check allocs using the non-debug version of new