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/TabSRMM/src/eventpopups.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp index b1759de869..8dff9716bb 100644 --- a/plugins/TabSRMM/src/eventpopups.cpp +++ b/plugins/TabSRMM/src/eventpopups.cpp @@ -54,13 +54,14 @@ static PLUGIN_DATAT* PU_GetByContact(const MCONTACT hContact) */ static void PU_CleanUp() { - for (auto &p : arPopupList.rev_iter()) { + auto T = arPopupList.rev_iter(); + for (auto &p : T) { if (p->hContact != 0) continue; mir_free(p->eventData); mir_free(p); - arPopupList.remove(p); + arPopupList.remove(T.indexOf(&p)); } } -- cgit v1.2.3