summaryrefslogtreecommitdiff
path: root/protocols/JabberG
diff options
context:
space:
mode:
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)