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:
parent
5365a33b57
commit
613f622674
@ -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.
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user