From 4c281b28075dfa69d8cc2301b06492fbddb62f24 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 30 Jan 2020 20:18:37 +0300 Subject: LIST::remove + LIST::indexOf() combination removed with LIST::removeItem --- plugins/Clist_modern/src/modern_skinengine.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'plugins/Clist_modern/src/modern_skinengine.cpp') diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index cbc0a3ccae..427ac780d5 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -525,10 +525,9 @@ int ske_ReleaseBufferDC(HDC hDC, int keepTime) { DWORD dwCurrentTime = GetTickCount(); - //Try to find DC in buffer list - set flag to be release after time; + // Try to find DC in buffer list - set flag to be release after time; mir_cslock lck(BufferListCS); - auto T = BufferList.rev_iter(); - for (auto &it : T) { + for (auto &it : BufferList.rev_iter()) { if (it) { if (hDC != nullptr && it->hDC == hDC) { it->dwDestroyAfterTime = dwCurrentTime + keepTime; @@ -539,8 +538,7 @@ int ske_ReleaseBufferDC(HDC hDC, int keepTime) SelectObject(it->hDC, it->oldBitmap); DeleteObject(it->hBitmap); DeleteDC(it->hDC); - mir_free(it); - BufferList.remove(T.indexOf(&it)); + mir_free(BufferList.removeItem(&it)); } } } -- cgit v1.2.3