mirror of https://github.com/BOINC/boinc.git
Mgr: Clear our internal Internet cache when selecting a different computer; when removing entries from hash table, delete data to avoid memory leaks
This commit is contained in:
parent
a78f458ca2
commit
d95bf6945a
|
@ -7833,6 +7833,10 @@ 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.
|
||||
|
||||
clientgui/
|
||||
BOINCInternetFSHandler.cpp
|
||||
BOINCInternetFSHandler.cpp,.h
|
||||
NoticeListCtrl.cpp
|
||||
ViewNotices.cpp
|
||||
|
|
|
@ -626,17 +626,32 @@ void CBOINCInternetFSHandler::UnchacheMissingItems() {
|
|||
m_Hash->BeginFind();
|
||||
wxHashTable::Node* node = m_Hash->Next();
|
||||
for(;;) {
|
||||
if (node == NULL) return;
|
||||
if (node == NULL) return; // End of cache
|
||||
MemFSHashObj* obj = (MemFSHashObj*)node->GetData();
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CBOINCInternetFSHandler::ClearCache() {
|
||||
m_Hash->BeginFind();
|
||||
wxHashTable::Node* node = m_Hash->Next();
|
||||
for(;;) {
|
||||
if (node == NULL) return; // End of cache
|
||||
MemFSHashObj* obj = (MemFSHashObj*)node->GetData();
|
||||
// We must get next node before deleting this one
|
||||
node = m_Hash->Next();
|
||||
delete obj;
|
||||
m_Hash->Delete(obj->m_Key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CBOINCInternetFSHandler::ShutDown() {
|
||||
b_ShuttingDown = true;
|
||||
#ifdef __WXMSW__
|
||||
|
|
|
@ -31,6 +31,7 @@ public:
|
|||
virtual bool CanOpen(const wxString& strLocation);
|
||||
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& strLocation);
|
||||
void UnchacheMissingItems();
|
||||
void ClearCache();
|
||||
void ShutDown();
|
||||
|
||||
protected:
|
||||
|
|
|
@ -542,6 +542,7 @@ void CNoticeListCtrl::Clear() {
|
|||
SetItemCount(0);
|
||||
m_bComputerChanged = true;
|
||||
UpdateUI();
|
||||
Refresh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -141,6 +141,8 @@ void CViewNotices::OnListRender(wxTimerEvent& WXUNUSED(event)) {
|
|||
strLastMachineName = strNewMachineName;
|
||||
m_FetchingNoticesText->Show();
|
||||
m_NoNoticesText->Hide();
|
||||
wxFileSystemHandler *internetFSHandler = wxGetApp().GetInternetFSHandler();
|
||||
((CBOINCInternetFSHandler*)internetFSHandler)->ClearCache();
|
||||
m_pHtmlListPane->Clear();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue