Getting the message "Memory leaked", doesnt mean that you have a memory leak. It means that only some difference is there in memory conumption at that time. When using MFC there are no unavoidable leaks, may be there is some memory consumption. for example see the below code
CMemoryState new, old, diff;
old.CheckPoint();
m_csMyStr.LoadString( IDS_MYSTRING );
old.CheckPoint();
if( diff.Difference( old, new ))
{
AfxMessageBox( "Mem Leak" );
}
It gives the message "Mem Leak". But is there any memory leak that the programmer needs to resove. No right?
but you need to make sure that what all you have
new
ed, you just need to
delete
If you debug your code, you can find the memory leak in visual studio IDE itself. In
debug window.