Use the WX_CLEAR_HASH_TABLE macro to clear the notices hash table

This commit is contained in:
Charlie Fenton 2012-12-21 07:58:32 -08:00 committed by Oliver Bock
parent 2ceec2926e
commit 58e0757e1d
2 changed files with 2 additions and 14 deletions

View File

@ -7833,8 +7833,7 @@ Rom 20 Dec 2012
Charlie 21 Dec 2012 Charlie 21 Dec 2012
- Mgr: If network activity is suspended, don't retrieve URL references within - Mgr: If network activity is suspended, don't retrieve URL references within
notices unless they are already in our cache or in the Windows cache. notices unless they are already in our cache or in the Windows cache.
- Mgr: Clear our internal Internet cache when selecting a different computer; - Mgr: Clear our internal Internet cache when selecting a different computer.
when removing entries from hash table, delete data to avoid memory leaks.
- Mgr: Display a message and "Retry now" button if some images or other items - Mgr: Display a message and "Retry now" button if some images or other items
within notices failed to load from the Internet; if network activity is within notices failed to load from the Internet; if network activity is
suspended, say so in the message. suspended, say so in the message.

View File

@ -639,18 +639,7 @@ void CBOINCInternetFSHandler::UnchacheMissingItems() {
void CBOINCInternetFSHandler::ClearCache() { void CBOINCInternetFSHandler::ClearCache() {
m_Hash->BeginFind(); WX_CLEAR_HASH_TABLE(*m_Hash);
wxHashTable::Node* node = m_Hash->Next();
for(;;) {
if (node == NULL) break; // End of cache
MemFSHashObj* obj = (MemFSHashObj*)node->GetData();
// We must get next node before deleting this one
node = m_Hash->Next();
if (obj->m_Data) {
delete[] obj->m_Data;
}
m_Hash->Delete(obj->m_Key);
}
m_bMissingItems = false; m_bMissingItems = false;
} }