}
-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);
}
* so we can avoid showing the account settings twice for the same modest account: */
priv->account_settings_dialog_hash = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
-
+
/* Respond to volume mounts and unmounts, such
* as the insertion/removal of the memory card: */
/* This is a singleton, so it does not need to be unrefed. */
priv->password_hash = NULL;
}
+ if (priv->account_settings_dialog_hash) {
+ g_hash_table_destroy (priv->account_settings_dialog_hash);
+ priv->account_settings_dialog_hash = NULL;
+ }
+
/* Disconnect VFS signals */
volume_monitor = gnome_vfs_get_volume_monitor ();
if (g_signal_handler_is_connected (volume_monitor,
folders = tny_simple_list_new ();
tny_folder_store_get_folders (TNY_FOLDER_STORE (account_outbox),
folders, NULL, NULL);
- g_assert (tny_list_get_length (folders) == 1);
+ if (tny_list_get_length (folders) != 1)
+ g_warning ("%s: there should be only one outbox folder, but found %d!",
+ __FUNCTION__, tny_list_get_length (folders));
iter_folders = tny_list_create_iterator (folders);
per_account_outbox = TNY_FOLDER (tny_iterator_get_current (iter_folders));
g_object_unref (iter_folders);
+ g_object_unref (folders);
g_object_unref (account_outbox);
/* Add the outbox of the new per-account-local-outbox