Index: C:/Code/Battle/Source/Library/Boost/libs/thread/src/tss_hooks.cpp =================================================================== --- C:/Code/Battle/Source/Library/Boost/libs/thread/src/tss_hooks.cpp (revision 564) +++ C:/Code/Battle/Source/Library/Boost/libs/thread/src/tss_hooks.cpp (revision 567) @@ -18,6 +18,10 @@ #define WIN32_LEAN_AND_MEAN #include +#if defined(BOOST_MSVC) && defined(_DEBUG) + #include +#endif + namespace { typedef std::list thread_exit_handlers; @@ -26,6 +30,20 @@ boost::mutex* threadmon_mutex; void init_threadmon_mutex(void) { +#if defined(BOOST_MSVC) && defined(_DEBUG) + // threadmon_mutex is never explicitly deallocated, but only allocated once. + // This is harmless, but MSVC CRT debugging shows it as a "memory leak". + // temporarily turn off leak tracking for this allocation. + class suppresscrtdbg + { + public: + suppresscrtdbg() : dbgflag(_CrtSetDbgFlag( 0 )) {} + ~suppresscrtdbg() {_CrtSetDbgFlag(dbgflag);} + private: + int dbgflag; + }; + suppresscrtdbg scd; +#endif threadmon_mutex = new boost::mutex; if (!threadmon_mutex) throw boost::thread_resource_error();