[Telepathy-commits] [telepathy-gabble/master] Remove previous location before adding new location

Pierre-Luc Beaudoin pierre-luc.beaudoin at collabora.co.uk
Sun Feb 1 05:23:58 PST 2009


---
 src/presence-cache.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/presence-cache.c b/src/presence-cache.c
index dddc271..2e6be1f 100644
--- a/src/presence-cache.c
+++ b/src/presence-cache.c
@@ -1792,7 +1792,7 @@ static void update_location_for_each (gpointer key,
 
 void gabble_presence_cache_update_location (GabblePresenceCache *cache,
                                             TpHandle handle,
-                                            GHashTable *location)
+                                            GHashTable *new_location)
 {
   GabblePresenceCachePrivate *priv = GABBLE_PRESENCE_CACHE_PRIV (cache);
   GHashTable *cur_location;
@@ -1804,7 +1804,8 @@ void gabble_presence_cache_update_location (GabblePresenceCache *cache,
         (GDestroyNotify) tp_g_value_slice_free);
 
   // Copy keys
-  g_hash_table_foreach (location, update_location_for_each, cur_location);
+  g_hash_table_remove_all (cur_location);
+  g_hash_table_foreach (new_location, update_location_for_each, cur_location);
 
   g_hash_table_replace (priv->location, GINT_TO_POINTER (handle), cur_location);
 
-- 
1.5.6.5




More information about the Telepathy-commits mailing list