diff --git a/clientgui/ViewMessages.cpp b/clientgui/ViewMessages.cpp index ee560dab07..1ce6b8df39 100644 --- a/clientgui/ViewMessages.cpp +++ b/clientgui/ViewMessages.cpp @@ -422,7 +422,8 @@ wxInt32 CViewMessages::GetCacheCount() wxInt32 CViewMessages::RemoveCacheElement() { - m_MessageCache.erase( m_MessageCache.end() ); + delete m_MessageCache.back(); + m_MessageCache.erase( m_MessageCache.end() - 1 ); return 0; } diff --git a/clientgui/ViewProjects.cpp b/clientgui/ViewProjects.cpp index 7d2118577c..e8ab450895 100644 --- a/clientgui/ViewProjects.cpp +++ b/clientgui/ViewProjects.cpp @@ -625,7 +625,8 @@ wxInt32 CViewProjects::GetCacheCount() wxInt32 CViewProjects::RemoveCacheElement() { - m_ProjectCache.erase( m_ProjectCache.end() ); + delete m_ProjectCache.back(); + m_ProjectCache.erase( m_ProjectCache.end() - 1 ); return 0; } diff --git a/clientgui/ViewResources.cpp b/clientgui/ViewResources.cpp index 8b2b97d47e..8edbf0b3aa 100644 --- a/clientgui/ViewResources.cpp +++ b/clientgui/ViewResources.cpp @@ -289,7 +289,8 @@ wxInt32 CViewResources::GetCacheCount() wxInt32 CViewResources::RemoveCacheElement() { - m_ResourceCache.erase( m_ResourceCache.end() ); + delete m_ResourceCache.back(); + m_ResourceCache.erase( m_ResourceCache.end() - 1 ); return 0; } diff --git a/clientgui/ViewTransfers.cpp b/clientgui/ViewTransfers.cpp index e7efc5b416..1cc9e6e144 100644 --- a/clientgui/ViewTransfers.cpp +++ b/clientgui/ViewTransfers.cpp @@ -462,7 +462,8 @@ wxInt32 CViewTransfers::GetCacheCount() wxInt32 CViewTransfers::RemoveCacheElement() { - m_TransferCache.erase( m_TransferCache.end() ); + delete m_TransferCache.back(); + m_TransferCache.erase( m_TransferCache.end() - 1 ); return 0; } diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index f11cecfb76..5cbe354a52 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -538,7 +538,8 @@ wxInt32 CViewWork::GetCacheCount() wxInt32 CViewWork::RemoveCacheElement() { - m_WorkCache.erase( m_WorkCache.end() ); + delete m_WorkCache.back(); + m_WorkCache.erase( m_WorkCache.end() - 1 ); return 0; }