From 58e0757e1d9447dfa44f91297898dd67f60273f2 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 21 Dec 2012 07:58:32 -0800 Subject: [PATCH] Use the WX_CLEAR_HASH_TABLE macro to clear the notices hash table --- checkin_notes | 3 +-- clientgui/BOINCInternetFSHandler.cpp | 13 +------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/checkin_notes b/checkin_notes index 84b404e085..0c71f72674 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7833,8 +7833,7 @@ Rom 20 Dec 2012 Charlie 21 Dec 2012 - 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. - - Mgr: Clear our internal Internet cache when selecting a different computer; - when removing entries from hash table, delete data to avoid memory leaks. + - Mgr: Clear our internal Internet cache when selecting a different computer. - 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 suspended, say so in the message. diff --git a/clientgui/BOINCInternetFSHandler.cpp b/clientgui/BOINCInternetFSHandler.cpp index 70c85cb9a0..f3fb2504d4 100755 --- a/clientgui/BOINCInternetFSHandler.cpp +++ b/clientgui/BOINCInternetFSHandler.cpp @@ -639,18 +639,7 @@ void CBOINCInternetFSHandler::UnchacheMissingItems() { void CBOINCInternetFSHandler::ClearCache() { - m_Hash->BeginFind(); - 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); - } + WX_CLEAR_HASH_TABLE(*m_Hash); m_bMissingItems = false; }