added windows memory checker (must define WIN32_MEMORY_DEBUG in unit.vcproj and undef USE_PHRQ_ALLOC in IPhreeqc.vsprops)

no leaks

git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8831 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
Scott R Charlton 2014-07-10 05:46:33 +00:00
parent 05f70fb8e7
commit a5ad315911

View File

@ -68,6 +68,31 @@ double CStopWatch::getElapsedTime()
int main(int argc, char **argv)
{
#if defined(WIN32_MEMORY_DEBUG)
int tmpDbgFlag;
/*
* Set the debug-heap flag to keep freed blocks in the
* heap's linked list - This will allow us to catch any
* inadvertent use of freed memory
*/
#ifdef SKIP
// Send messages (leaks) to stderr
_CrtSetReportMode( _CRT_ERROR, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ERROR, _CRTDBG_FILE_STDERR );
_CrtSetReportMode( _CRT_WARN, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_WARN, _CRTDBG_FILE_STDERR );
_CrtSetReportMode( _CRT_ASSERT, _CRTDBG_MODE_FILE );
_CrtSetReportFile( _CRT_ASSERT, _CRTDBG_FILE_STDERR );
#endif
tmpDbgFlag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
//tmpDbgFlag |= _CRTDBG_DELAY_FREE_MEM_DF;
tmpDbgFlag |= _CRTDBG_LEAK_CHECK_DF;
///tmpDbgFlag |= _CRTDBG_CHECK_ALWAYS_DF;
_CrtSetDbgFlag(tmpDbgFlag);
//_crtBreakAlloc = 31195;
#endif
CppUnit::TextUi::TestRunner runner;
#if defined(_MSC_VER)