g_direct_equal,
(GDestroyNotify)my_object_unref, /* ref'd GObject */
(GDestroyNotify)my_object_unref); /* ref'd GObject */
-
}
priv = MODEST_CACHE_MGR_GET_PRIVATE(obj);
modest_cache_mgr_flush_all (self);
-
+
priv->date_str_cache = NULL;
priv->display_str_cache = NULL;
priv->pixbuf_cache = NULL;
}
-static gboolean
-always_true (gpointer key, gpointer value, gpointer user_data)
-{
- return TRUE;
-}
-
-
void
modest_cache_mgr_flush (ModestCacheMgr *self, ModestCacheMgrCacheType type)
{
g_return_if_fail (self);
g_return_if_fail (type >= 0 && type <= MODEST_CACHE_MGR_CACHE_TYPE_NUM);
-
+
priv = MODEST_CACHE_MGR_GET_PRIVATE(self);
cache = get_cache (priv, type);
if (cache)
- g_hash_table_foreach_remove (cache, always_true, NULL);
- /* g_hash_table_remove_all (cache) in only available since GLIB 2.12 */
+ g_hash_table_destroy (cache);
}
{
int i;
g_return_if_fail (self);
-
+
for (i = 0; i != MODEST_CACHE_MGR_CACHE_TYPE_NUM; ++i)
modest_cache_mgr_flush (self, i);
}