From 2ceec2926e4c58ae8397081eb4adcef69abae279 Mon Sep 17 00:00:00 2001 From: Charlie Fenton Date: Fri, 21 Dec 2012 06:23:02 -0800 Subject: [PATCH] When removing entries from hash table, delete only the contents of the cached data (pointed to by m_data), not the entire MemFSHashObj --- clientgui/BOINCInternetFSHandler.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/clientgui/BOINCInternetFSHandler.cpp b/clientgui/BOINCInternetFSHandler.cpp index e634ea586b..70c85cb9a0 100755 --- a/clientgui/BOINCInternetFSHandler.cpp +++ b/clientgui/BOINCInternetFSHandler.cpp @@ -631,7 +631,6 @@ void CBOINCInternetFSHandler::UnchacheMissingItems() { // We must get next node before deleting this one node = m_Hash->Next(); if (obj->m_Len == 0) { - delete obj; m_Hash->Delete(obj->m_Key); } } @@ -647,7 +646,9 @@ void CBOINCInternetFSHandler::ClearCache() { MemFSHashObj* obj = (MemFSHashObj*)node->GetData(); // We must get next node before deleting this one node = m_Hash->Next(); - delete obj; + if (obj->m_Data) { + delete[] obj->m_Data; + } m_Hash->Delete(obj->m_Key); } m_bMissingItems = false;