[Telepathy-commits] [telepathy-gabble/master] vcard-manager: cache_entry_complete_requests: stop to iterate if the entry was removed from the cache (fd.o #16918)

Guillaume Desmottes guillaume.desmottes at collabora.co.uk
Tue Aug 19 10:54:15 PDT 2008


20080731095956-7fe3f-d40a0db23931700f9ef19db5e8c79efe5c7f87a7.gz
---
 src/vcard-manager.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/vcard-manager.c b/src/vcard-manager.c
index 88748ed..af41ac2 100644
--- a/src/vcard-manager.c
+++ b/src/vcard-manager.c
@@ -451,7 +451,14 @@ static void complete_one_request (GabbleVCardManagerRequest *request,
 static void
 cache_entry_complete_requests (GabbleVCardCacheEntry *entry, GError *error)
 {
-  while (entry->pending_requests)
+  GabbleVCardManagerPrivate *priv = GABBLE_VCARD_MANAGER_GET_PRIVATE
+      (entry->manager);
+  TpHandle handle;
+
+  handle = entry->handle;
+
+  while (g_hash_table_lookup (priv->cache, GUINT_TO_POINTER (handle)) != NULL &&
+      entry->pending_requests)
     {
       GabbleVCardManagerRequest *request = entry->pending_requests->data;
 
-- 
1.5.6.3




More information about the Telepathy-commits mailing list