From 44b60862c97e5ec855d2bacd4d15f81f7ae7f410 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Mar 2018 15:33:54 +0300 Subject: MUCH more effective way of removing records from iterators --- plugins/Clist_modern/src/modern_aniavatars.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index bc72629674..c04448b182 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -265,10 +265,11 @@ static void _AniAva_ResumePainting() static void _AniAva_ReduceAvatarImages(int startY, int dY, BOOL bDestroyWindow) { - for (auto &it : s_Objects.rev_iter()) { + auto T = s_Objects.rev_iter(); + for (auto &it : T) { int res = SendMessage(it->hWindow, AAM_REMOVEAVATAR, (WPARAM)startY, (LPARAM)dY); if (res == 0xDEAD && bDestroyWindow) - s_Objects.remove(it); + s_Objects.remove(T.indexOf(&it)); } } -- cgit v1.2.3