Fix compiler warning and some crash possibilities. 2008-07-26 Srinivasa
authorSrinivasa Ragavan <sragavan@novell.com>
Sat, 26 Jul 2008 12:46:30 +0000 (12:46 +0000)
committerSrinivasa Ragavan <sragavan@src.gnome.org>
Sat, 26 Jul 2008 12:46:30 +0000 (12:46 +0000)
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/providers/imap/camel-imap-folder.c: Fix compiler warnings.

svn path=/trunk/; revision=9198

camel/ChangeLog
camel/camel-folder-summary.c
camel/providers/imap/ChangeLog
camel/providers/imap/camel-imap-folder.c

index 8450a8f..9940ede 100644 (file)
@@ -1,5 +1,10 @@
 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.
 
index 791788b..a76ad96 100644 (file)
@@ -1991,14 +1991,17 @@ camel_folder_summary_remove_uid(CamelFolderSummary *s, const char *uid)
                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);
        }
 }
 
index bea5582..6e275c0 100644 (file)
@@ -1,3 +1,7 @@
+2008-07-26  Srinivasa Ragavan  <sragavan@novell.com>
+
+       * camel/providers/imap/camel-imap-folder.c: Fix compiler warnings.
+
 2008-07-25  Milan Crha  <mcrha@redhat.com>
 
        ** Fix for bug #544049
index 433be54..a097859 100644 (file)
@@ -1279,7 +1279,7 @@ imap_sync_online (CamelFolder *folder, CamelException *ex)
                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 */
@@ -3220,7 +3220,7 @@ camel_imap_folder_changed (CamelFolder *folder, int exists,
        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);
@@ -3231,18 +3231,18 @@ camel_imap_folder_changed (CamelFolder *folder, int exists,
                                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);