[Xfce4-commits] <garcon:master> Use g_hash_table_remove_all to clear invalidate the cache.

Nick Schermer nick at xfce.org
Mon Aug 17 18:16:06 CEST 2009


Updating branch refs/heads/master
         to 415fd0ea800c21546b5fa170a560beaa36e18fa3 (commit)
       from bcc9171e5cf4eeed62eb271f2e2f1c9a3aa147ec (commit)

commit 415fd0ea800c21546b5fa170a560beaa36e18fa3
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Aug 17 17:41:53 2009 +0200

    Use g_hash_table_remove_all to clear invalidate the cache.

 garcon/garcon-menu-item-cache.c |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/garcon/garcon-menu-item-cache.c b/garcon/garcon-menu-item-cache.c
index d2d74b0..e07c261 100644
--- a/garcon/garcon-menu-item-cache.c
+++ b/garcon/garcon-menu-item-cache.c
@@ -217,10 +217,6 @@ garcon_menu_item_cache_invalidate (GarconMenuItemCache *cache)
 {
   g_return_if_fail (GARCON_IS_MENU_ITEM_CACHE (cache));
 
-  /* Destroy the hash table */
-  g_hash_table_unref (cache->priv->items);
-
-  /* Create a new, empty hash table */
-  cache->priv->items = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
-                                              (GDestroyNotify) garcon_menu_item_unref);
+  /* Remove all items from the hash table */
+  g_hash_table_remove_all (cache->priv->items);
 }



More information about the Xfce4-commits mailing list