summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-09-16 12:13:42 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-09-16 12:13:42 +0300
commit4ef73611c5a7ced80710666dd35131e8b6c8c219 (patch)
tree075e211011fbf143517b835477673c99480e2a02 /protocols/JabberG
parent942375f9541adc8553c9868322e6757b8da704d7 (diff)
Jabber: more effective list destruction procedure
Diffstat (limited to 'protocols/JabberG')
-rw-r--r--protocols/JabberG/src/jabber_list.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp
index 08e7eb0cff..46752efd9d 100644
--- a/protocols/JabberG/src/jabber_list.cpp
+++ b/protocols/JabberG/src/jabber_list.cpp
@@ -175,9 +175,13 @@ void CJabberProto::ListRemove(JABBER_LIST list, const char *jid)
void CJabberProto::ListRemoveList(JABBER_LIST list)
{
- int i = 0;
- while ((i = ListFindNext(list, i)) >= 0)
- ListRemoveByIndex(i);
+ mir_cslock lck(m_csLists);
+ for (auto &it : m_lstRoster.rev_iter()) {
+ if (it->list == list) {
+ delete it;
+ m_lstRoster.remove(m_lstRoster.indexOf(&it));
+ }
+ }
}
void CJabberProto::ListRemoveByIndex(int index)