- glib < 2.12 does not support g_hash_table_remove_all, therefore
use g_hash_table_foreach_remove instead
pmo-trunk-r693
}
+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 (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_remove_all (cache);
+ g_hash_table_foreach_remove (cache, always_true, NULL);
+ /* g_hash_table_remove_all (cache) in only available since GLIB 2.12 */
}