2008-07-26 Srinivasa Ragavan <sragavan@novell.com>
+ * camel/camel-folder-summary.c: Fix compiler warning and some crash
+ possibilities.
+
+2008-07-26 Srinivasa Ragavan <sragavan@novell.com>
+
* camel/camel-folder-summary.c: Another possible deadlock. Never hold
summary lock and do a db operation.
camel_folder_summary_remove(s, oldinfo);
camel_message_info_free(oldinfo);
} else {
+ char *tmpid = g_strdup (uid);
/* Info isn't loaded into the memory. We must just remove the UID*/
summary_remove_uid (s, uid);
CAMEL_SUMMARY_UNLOCK(s, ref_lock);
CAMEL_SUMMARY_UNLOCK(s, summary_lock);
- if (camel_db_delete_uid (s->folder->cdb, s->folder->full_name, camel_message_info_uid(info), NULL) != 0)
+ if (camel_db_delete_uid (s->folder->cdb, s->folder->full_name, tmpid, NULL) != 0) {
+ g_free(tmpid);
return ;
-
+ }
+ g_free (tmpid);
}
}
CAMEL_SERVICE_REC_LOCK (store, connect_lock);
}
- g_ptr_array_foreach (summary, camel_pstring_free, NULL);
+ g_ptr_array_foreach (summary, (GFunc) camel_pstring_free, NULL);
g_ptr_array_free (summary, TRUE);
/* Save the summary */
changes = camel_folder_change_info_new ();
if (expunged) {
int i, id;
- GList *deleted = NULL;
+ GSList *deleted = NULL;
for (i = 0; i < expunged->len; i++) {
id = g_array_index (expunged, int, i);
continue;
}
- deleted = g_list_prepend(deleted, uid);
+ deleted = g_slist_prepend(deleted, uid);
camel_folder_change_info_remove_uid (changes, uid);
CAMEL_IMAP_FOLDER_REC_LOCK (imap_folder, cache_lock);
camel_imap_message_cache_remove (imap_folder->cache, uid);
CAMEL_IMAP_FOLDER_REC_UNLOCK (imap_folder, cache_lock);
- camel_folder_summary_remove_index_fast (CamelFolderSummary *s, id-1)
+ camel_folder_summary_remove_index_fast (folder->summary, id-1);
}
/* Delete all in one transaction */
camel_db_delete_uids (folder->cdb, folder->full_name, deleted, ex);
- g_list_foreach (deleted, g_free);
- g_list_free (deleted);
+ g_slist_foreach (deleted, (GFunc) g_free, NULL);
+ g_slist_free (deleted);
}
len = camel_folder_summary_count (folder->summary);