summaryrefslogtreecommitdiff
path: root/protocols/FacebookRM/src/process.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/FacebookRM/src/process.cpp')
-rw-r--r--protocols/FacebookRM/src/process.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/protocols/FacebookRM/src/process.cpp b/protocols/FacebookRM/src/process.cpp
index fbbbb0c657..8b4778f8b2 100644
--- a/protocols/FacebookRM/src/process.cpp
+++ b/protocols/FacebookRM/src/process.cpp
@@ -232,15 +232,13 @@ void FacebookProto::ProcessFriendList(void* data)
}
// Check remaining contacts in map and add them to contact list
- for (std::map< std::string, facebook_user* >::iterator iter = friends.begin(); iter != friends.end(); ++iter) {
- facebook_user *fbu = iter->second;
+ for (std::map< std::string, facebook_user* >::iterator it = friends.begin(); it != friends.end(); ) {
+ if (!it->second->deleted)
+ AddToContactList(it->second, CONTACT_FRIEND, true); // there could be race-condition between this thread and channel/buddy_list thread, so this contact might be created already
- if (!fbu->deleted)
- MCONTACT hContact = AddToContactList(fbu, CONTACT_FRIEND/*, true*/); // This contact is surely new ...am I sure? ...I'm not, so "true" is commented now
-
- delete fbu;
+ delete it->second;
+ it = friends.erase(it);
}
-
friends.clear();
debugLogA("***** Friend list processed");