作者:朱金灿
来源:http://blog.csdn.net/clever101
之前遇到过一次VS 2008内存泄露误报事故,详见:《坑爹的VS2008内存泄露报告》。目前据我所知,在使用boost库和osg库都存在此种内存泄露误报问题。今天从网上找到了一个英文帖子:Whydoes my OSG MFC based application show memory leaks,正是对这种内存泄露误报的原因的很好的解释。
帖子摘要如下:
There is a known issue/BUG with MFC, were MFCmakes a call to
_CrtDumpMemoryLeaks() in the destructor of the_AFX_DEBUG_STATE, followed by _CrtSetDbgFlag() which sets it to~_CRTDBG_LEAK_CHECK_DF (therefor disabling memory leak test a