Plugging a memory leak in FlushIconInfo.

git-svn-id: svn://10.0.0.236/trunk@3109 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt 1998-06-03 21:38:06 +00:00
parent 5365a33b57
commit 613f622674
2 changed files with 23 additions and 17 deletions

View File

@ -29,26 +29,11 @@ enum IconType { BUILTIN_BITMAP, LOCAL_FILE, ARBITRARY_URL }; // TODO: Use this i
class CHTFEData
{
private:
CHTFEData(); // Disallow the instantiation of objects of this class.
CHTFEData() {}; // Disallow the instantiation of objects of this class.
public:
static void FlushIconInfo()
{
// Just remove the HICONs from the local file cache.
m_LocalFileCache.RemoveAll();
// Need to iterate over all the elements in the custom URL cache and destroy the images.
POSITION pos = m_CustomURLCache.GetStartPosition();
void* pData;
CString key;
while (pos != NULL)
{
m_CustomURLCache.GetNextAssoc(pos, key, pData);
CRDFImage* pImage = (CRDFImage*)pData;
delete pImage;
}
}
static void FlushIconInfo();
static CMapStringToPtr m_LocalFileCache;
// Hashed on file extension e.g., .html would hold the icon for HTML files.

View File

@ -3748,6 +3748,27 @@ CWnd* CRDFCX::GetDialogOwner() const
return m_pCurrentRDFWindow->GetTopLevelFrame();
}
// ==================================================================
// HTFEDATA Functions (found in rdfacc.h)
// ==================================================================
void CHTFEData::FlushIconInfo()
{
// Just remove the HICONs from the local file cache.
m_LocalFileCache.RemoveAll();
// Need to iterate over all the elements in the custom URL cache and destroy the images.
POSITION pos = m_CustomURLCache.GetStartPosition();
void* pData;
CString key;
while (pos != NULL)
{
m_CustomURLCache.GetNextAssoc(pos, key, pData);
CRDFImage* pImage = (CRDFImage*)pData;
delete pImage;
}
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////