Detected memory leaks!
Dumping objects ->
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\strcore.cpp(156) : {4873} normal block at 0x069959A0, 26 bytes long.
Data: 78 C5 9C 0F 09 00 00 00 09 00 00 00 01 00 00 00
{97} client block at 0x003F9D30, subtype c0, 64 bytes long.
f:\dd\vctools\vc7libs\ship\atlmfc\src\mfc\dumpcont.cpp(23) : atlTraceGeneral - a CDynLinkLibrary object at $003F9D30, 64 bytes long
Object dump complete.
記憶體洩露的原因:
BOOL CSmartApp::InitInstance()
{
m_hLangDLL = ::LoadLibrary(_T("LangEnglish.dll"));
}
沒有釋放動态庫。
int CSmartApp::ExitInstance()
if (NULL != m_hLangDLL)
{
AfxFreeLibrary(m_hLangDLL);//不可使用::FreeLibrary()函數,會記憶體洩露
}