第一步,是卸载dll先后顺序的问题,让OgreMain_d.dll在mfc80d.dll之前析构,老外早就有分析了:
i) in the General tab, switch "Use MFC in a shared DLL" to "Use Standard Windows Libraries"
ii) in the C/C++/Preprocessor tab, add _AFXDLL to the preprocessor definitions
iii) in the Linker/Input tab, add mfc90ud.lib anywhere before OgreMain_d.lib
第二步,删除自己代码中的所有的#defin new DEBUG_NEW,然后在 CApp的构造函数中加入 AfxEnableMemoryTracking(FALSE);
机子本来不快,这样总不至于程序结束的时候慢死。。。自己写代码注意内存问题
出现错误:
1>Compiling...
1>stdafx.cpp
1>d:/program files/microsoft visual studio 9.0/vc/atlmfc/include/afxver_.h(81) : fatal error C1189: #error : Please use the /MD switch for _AFXDLL builds
解决方法:
c/c++ ---- Code Generation --------- runtime library 改为 “Multi-threaded Debug DLL (/MDd)”
Ogre与MFC结合时的内存泄漏问题
最新推荐文章于 2015-04-03 16:25:24 发布
本文介绍了解决MFC与Ogre1.6冲突导致的内存泄漏问题的方法,包括调整DLL卸载顺序及禁用内存跟踪等步骤。

895

被折叠的 条评论
为什么被折叠?



