[evolution-data-server] Add camel_message_info_unref().



commit 965420b3a47743d4d639bb52750934c18a52eb6e
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Sep 16 11:11:47 2013 -0400

    Add camel_message_info_unref().
    
    Replaces camel_message_info_free().
    
    CamelMessageInfo is reference-counted, so naming the unreferencing
    function "free" is very misleading.

 camel/camel-disco-folder.c                    |    2 +-
 camel/camel-filter-driver.c                   |    8 +++---
 camel/camel-folder-search.c                   |    2 +-
 camel/camel-folder-summary.c                  |   28 ++++++++++----------
 camel/camel-folder-summary.h                  |    2 +-
 camel/camel-folder.c                          |   20 ++++++--------
 camel/camel-imapx-folder.c                    |    2 +-
 camel/camel-imapx-server.c                    |   34 ++++++++++++------------
 camel/camel-imapx-utils.c                     |    8 +++---
 camel/camel-vee-folder.c                      |    4 +-
 camel/camel-vee-summary.c                     |   24 +++++++++---------
 camel/providers/local/camel-local-summary.c   |    2 +-
 camel/providers/local/camel-maildir-folder.c  |   10 +++---
 camel/providers/local/camel-maildir-summary.c |   12 ++++----
 camel/providers/local/camel-mbox-folder.c     |   12 ++++----
 camel/providers/local/camel-mbox-summary.c    |   30 +++++++++++-----------
 camel/providers/local/camel-mh-folder.c       |    2 +-
 camel/providers/local/camel-mh-summary.c      |   12 ++++----
 camel/providers/local/camel-spool-summary.c   |    2 +-
 camel/providers/nntp/camel-nntp-folder.c      |    4 +-
 camel/providers/nntp/camel-nntp-summary.c     |    2 +-
 docs/reference/camel/camel-sections.txt       |    2 +-
 22 files changed, 111 insertions(+), 113 deletions(-)
---
diff --git a/camel/camel-disco-folder.c b/camel/camel-disco-folder.c
index 0caa67a..51f1594 100644
--- a/camel/camel-disco-folder.c
+++ b/camel/camel-disco-folder.c
@@ -284,7 +284,7 @@ disco_expunge_sync (CamelFolder *folder,
                info = camel_folder_summary_get (folder->summary, uid);
                if (camel_message_info_flags (info) & CAMEL_MESSAGE_DELETED)
                        g_ptr_array_add (uids, (gpointer) uid);
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
        }
 
        success = disco_expunge_uids (folder, uids, cancellable, error);
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index b4c8bae..caa4917 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -1449,7 +1449,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
                        report_status (
                                driver, CAMEL_FILTER_STATUS_END,
                                100, _("Failed on message %d"), i);
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                        g_propagate_error (error, local_error);
                        goto fail;
                }
@@ -1459,7 +1459,7 @@ camel_filter_driver_filter_mbox (CamelFilterDriver *driver,
                /* skip over the FROM_END state */
                camel_mime_parser_step (mp, NULL, NULL);
 
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
        }
 
        camel_operation_progress (cancellable, 100);
@@ -1849,7 +1849,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
                g_object_unref (driver->priv->message);
 
        if (freeinfo)
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
 
        return 0;
 
@@ -1861,7 +1861,7 @@ camel_filter_driver_filter_message (CamelFilterDriver *driver,
                g_object_unref (driver->priv->message);
 
        if (freeinfo)
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
 
        g_propagate_error (error, driver->priv->error);
        driver->priv->error = NULL;
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index da446dd..032084b 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -934,7 +934,7 @@ folder_search_match_all (CamelSExp *sexp,
                } else {
                        g_ptr_array_add (r->value.ptrarray, (gchar *) uid);
                }
-               camel_message_info_free (search->current);
+               camel_message_info_unref (search->current);
        }
        search->current = NULL;
        return r;
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index 6bcbc6f..aa91eb0 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -181,7 +181,7 @@ remove_all_loaded (CamelFolderSummary *summary)
 
        g_hash_table_foreach_remove (summary->priv->loaded_infos, remove_each_item, &to_remove_infos);
 
-       g_slist_foreach (to_remove_infos, (GFunc) camel_message_info_free, NULL);
+       g_slist_foreach (to_remove_infos, (GFunc) camel_message_info_unref, NULL);
        g_slist_free (to_remove_infos);
 
        camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -2051,7 +2051,7 @@ remove_cache (CamelSession *session,
 
        g_hash_table_foreach_remove (summary->priv->loaded_infos, (GHRFunc) remove_item, &to_remove_infos);
 
-       g_slist_foreach (to_remove_infos, (GFunc) camel_message_info_free, NULL);
+       g_slist_foreach (to_remove_infos, (GFunc) camel_message_info_unref, NULL);
        g_slist_free (to_remove_infos);
 
        camel_folder_summary_unlock (summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -2155,7 +2155,7 @@ msg_update_preview (const gchar *uid,
                                camel_db_write_preview_record (parent_store->cdb_w, full_name, info->uid, 
info->preview, NULL);
                }
        }
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 }
 
 static void
@@ -2522,7 +2522,7 @@ camel_read_mir_callback (gpointer ref,
                        /* FIXME: this should be done differently, how i don't know */
                        ((CamelMessageInfoBase *) info)->content = perform_content_info_load_from_db 
(summary, mir);
                        if (((CamelMessageInfoBase *) info)->content == NULL) {
-                               camel_message_info_free (info);
+                               camel_message_info_unref (info);
                                info = NULL;
                        }
                        mir->cinfo = tmp;
@@ -2981,8 +2981,8 @@ camel_folder_summary_insert (CamelFolderSummary *summary,
  *
  * Create a new info record from a header.
  *
- * Returns: the newly allocated record which must be freed with
- * camel_message_info_free()
+ * Returns: the newly allocated record which must be unreferenced with
+ *          camel_message_info_unref()
  **/
 CamelMessageInfo *
 camel_folder_summary_info_new_from_header (CamelFolderSummary *summary,
@@ -3016,8 +3016,8 @@ camel_folder_summary_info_new_from_header (CamelFolderSummary *summary,
  * Once complete, the parser will be positioned at the end of
  * the message.
  *
- * Returns: the newly allocated record which must be freed with
- * camel_message_info_free()
+ * Returns: the newly allocated record which must be unreferenced with
+ *          camel_message_info_unref()
  **/
 CamelMessageInfo *
 camel_folder_summary_info_new_from_parser (CamelFolderSummary *summary,
@@ -3078,8 +3078,8 @@ camel_folder_summary_info_new_from_parser (CamelFolderSummary *summary,
  *
  * Create a summary item from a message.
  *
- * Returns: the newly allocated record which must be freed using
- * camel_message_info_free()
+ * Returns: the newly allocated record which must be unreferenced with
+ *          camel_message_info_unref()
  **/
 CamelMessageInfo *
 camel_folder_summary_info_new_from_message (CamelFolderSummary *summary,
@@ -3244,7 +3244,7 @@ camel_folder_summary_remove (CamelFolderSummary *summary,
        g_return_val_if_fail (info != NULL, FALSE);
 
        if (camel_folder_summary_remove_uid (summary, camel_message_info_uid (info))) {
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
                return TRUE;
        }
 
@@ -3339,7 +3339,7 @@ camel_folder_summary_remove_uids (CamelFolderSummary *summary,
                        g_hash_table_remove (summary->priv->loaded_infos, uid_copy);
 
                        if (mi)
-                               camel_message_info_free (mi);
+                               camel_message_info_unref (mi);
                        camel_pstring_free (uid_copy);
                }
        }
@@ -4437,13 +4437,13 @@ camel_message_info_new_from_header (CamelFolderSummary *summary,
 }
 
 /**
- * camel_message_info_free:
+ * camel_message_info_unref:
  * @info: a #CamelMessageInfo
  *
  * Unref's and potentially frees a #CamelMessageInfo and its contents.
  **/
 void
-camel_message_info_free (gpointer o)
+camel_message_info_unref (gpointer o)
 {
        CamelMessageInfo *mi = o;
 
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 4929338..58129c0 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -544,7 +544,7 @@ CamelMessageInfo *
                camel_message_info_new_from_header
                                                (CamelFolderSummary *summary,
                                                 struct _camel_header_raw *header);
-void           camel_message_info_free         (gpointer info);
+void           camel_message_info_unref        (gpointer info);
 gpointer       camel_message_info_clone        (gconstpointer info);
 
 /* accessors */
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index 38d96f0..2b3f7ca 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -139,10 +139,8 @@ async_context_free (AsyncContext *async_context)
        if (async_context->message != NULL)
                g_object_unref (async_context->message);
 
-       /* XXX This is actually an unref.  Good god, no wonder we
-        *     have so many crashes involving CamelMessageInfos! */
        if (async_context->info != NULL)
-               camel_message_info_free (async_context->info);
+               camel_message_info_unref (async_context->info);
 
        if (async_context->destination != NULL)
                g_object_unref (async_context->destination);
@@ -495,7 +493,7 @@ folder_transfer_message_to (CamelFolder *source,
                        source, uid, CAMEL_MESSAGE_DELETED |
                        CAMEL_MESSAGE_SEEN, ~0);
 
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 }
 
 static gboolean
@@ -693,7 +691,7 @@ folder_get_message_flags (CamelFolder *folder,
                return 0;
 
        flags = camel_message_info_flags (info);
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 
        return flags;
 }
@@ -714,7 +712,7 @@ folder_set_message_flags (CamelFolder *folder,
                return FALSE;
 
        res = camel_message_info_set_flags (info, flags, set);
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 
        return res;
 }
@@ -734,7 +732,7 @@ folder_get_message_user_flag (CamelFolder *folder,
                return FALSE;
 
        ret = camel_message_info_user_flag (info, name);
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 
        return ret;
 }
@@ -754,7 +752,7 @@ folder_set_message_user_flag (CamelFolder *folder,
                return;
 
        camel_message_info_set_user_flag (info, name, value);
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 }
 
 static const gchar *
@@ -772,7 +770,7 @@ folder_get_message_user_tag (CamelFolder *folder,
                return NULL;
 
        ret = camel_message_info_user_tag (info, name);
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 
        return ret;
 }
@@ -792,7 +790,7 @@ folder_set_message_user_tag (CamelFolder *folder,
                return;
 
        camel_message_info_set_user_tag (info, name, value);
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 }
 
 static GPtrArray *
@@ -898,7 +896,7 @@ folder_free_message_info (CamelFolder *folder,
 {
        g_return_if_fail (folder->summary != NULL);
 
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 }
 
 static void
diff --git a/camel/camel-imapx-folder.c b/camel/camel-imapx-folder.c
index 7e9d134..5a1f31f 100644
--- a/camel/camel-imapx-folder.c
+++ b/camel/camel-imapx-folder.c
@@ -590,7 +590,7 @@ imapx_get_message_sync (CamelFolder *folder,
                                        has_attachment ? CAMEL_MESSAGE_ATTACHMENTS : 0);
                        }
 
-                       camel_message_info_free (mi);
+                       camel_message_info_unref (mi);
                }
        }
 
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index cc719e9..7a082b1 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -648,7 +648,7 @@ append_message_data_free (AppendMessageData *data)
        g_free (data->path);
        g_free (data->appended_uid);
 
-       camel_message_info_free (data->info);
+       camel_message_info_unref (data->info);
 
        g_slice_free (AppendMessageData, data);
 }
@@ -1445,7 +1445,7 @@ imapx_expunge_uid_from_summary (CamelIMAPXServer *is,
        mi = camel_folder_summary_peek_loaded (folder->summary, uid);
        if (mi) {
                camel_folder_summary_remove (folder->summary, mi);
-               camel_message_info_free (mi);
+               camel_message_info_unref (mi);
        } else {
                camel_folder_summary_remove_uid (folder->summary, uid);
        }
@@ -1851,7 +1851,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
                        }
 
                        if (mi)
-                               camel_message_info_free (mi);
+                               camel_message_info_unref (mi);
                }
 
                g_clear_object (&select_folder);
@@ -1976,7 +1976,7 @@ imapx_untagged_fetch (CamelIMAPXServer *is,
                                        cnt = (camel_folder_summary_count (folder->summary) * 100 ) / 
ifolder->exists_on_server;
                                        camel_operation_progress (cancellable, cnt ? cnt : 1);
                                } else {
-                                       camel_message_info_free (mi);
+                                       camel_message_info_unref (mi);
                                }
 
                                if (free_user_flags && server_user_flags)
@@ -4903,10 +4903,10 @@ imapx_index_next (GPtrArray *uids,
                        continue;
 
                if (info && (strchr (camel_message_info_uid (info), '-') != NULL)) {
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                        e ('?', "Ignoring offline uid '%s'\n", camel_message_info_uid (info));
                } else {
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                        break;
                }
        }
@@ -5164,7 +5164,7 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
 
                                camel_folder_change_info_remove_uid (data->changes, uid);
                                removed = g_list_prepend (removed, (gpointer ) g_strdup (uid));
-                               camel_message_info_free (s_minfo);
+                               camel_message_info_unref (s_minfo);
                                s_minfo = NULL;
 
                                j = imapx_index_next (uids, s, j);
@@ -5190,7 +5190,7 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
                                fetch_new = TRUE;
 
                        if (s_minfo) {
-                               camel_message_info_free (s_minfo);
+                               camel_message_info_unref (s_minfo);
                                s_minfo = NULL;
                        }
 
@@ -5203,7 +5203,7 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
                }
 
                if (s_minfo)
-                       camel_message_info_free (s_minfo);
+                       camel_message_info_unref (s_minfo);
 
                while (j < uids->len) {
                        s_minfo = camel_folder_summary_get (s, g_ptr_array_index (uids, j));
@@ -5215,7 +5215,7 @@ imapx_job_scan_changes_done (CamelIMAPXServer *is,
 
                        e (is->tagprefix, "Message %s vanished\n", s_minfo->uid);
                        removed = g_list_prepend (removed, (gpointer) g_strdup (s_minfo->uid));
-                       camel_message_info_free (s_minfo);
+                       camel_message_info_unref (s_minfo);
                        j++;
                }
 
@@ -5928,7 +5928,7 @@ imapx_command_expunge_done (CamelIMAPXServer *is,
                                mi = camel_folder_summary_peek_loaded (folder->summary, uid);
                                if (mi) {
                                        camel_folder_summary_remove (folder->summary, mi);
-                                       camel_message_info_free (mi);
+                                       camel_message_info_unref (mi);
                                } else {
                                        camel_folder_summary_remove_uid (folder->summary, uid);
                                }
@@ -6609,7 +6609,7 @@ imapx_command_sync_changes_done (CamelIMAPXServer *is,
                        camel_flag_list_copy (&xinfo->server_user_flags, &xinfo->info.user_flags);
 
                        camel_folder_summary_touch (folder->summary);
-                       camel_message_info_free (xinfo);
+                       camel_message_info_unref (xinfo);
                }
                /* Apply the changes to server-side unread count; it won't tell
                 * us of these changes, of course. */
@@ -6739,7 +6739,7 @@ imapx_job_sync_changes_start (CamelIMAPXJob *job,
                                        else
                                                data->unread_change++;
                                }
-                               camel_message_info_free (info);
+                               camel_message_info_unref (info);
                        }
                }
 
@@ -7351,7 +7351,7 @@ imapx_server_get_message (CamelIMAPXServer *is,
        camel_imapx_job_set_data (
                job, data, (GDestroyNotify) get_message_data_free);
 
-       camel_message_info_free (mi);
+       camel_message_info_unref (mi);
        registered = imapx_register_job (is, job, error);
 
        QUEUE_UNLOCK (is);
@@ -7666,7 +7666,7 @@ imapx_sync_free_user (GArray *user_set)
 
                for (j = 0; j < infos->len; j++) {
                        CamelMessageInfo *info = g_ptr_array_index (infos, j);
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                }
 
                g_ptr_array_free (infos, TRUE);
@@ -7738,7 +7738,7 @@ imapx_server_sync_changes (CamelIMAPXServer *is,
                        continue;
 
                if (!(info->info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED)) {
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                        continue;
                }
 
@@ -7821,7 +7821,7 @@ imapx_server_sync_changes (CamelIMAPXServer *is,
                                g_ptr_array_add (change->infos, info);
                        }
                }
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
        }
 
        nothing_to_do =
diff --git a/camel/camel-imapx-utils.c b/camel/camel-imapx-utils.c
index ae30ca4..b49563a 100644
--- a/camel/camel-imapx-utils.c
+++ b/camel/camel-imapx-utils.c
@@ -1147,7 +1147,7 @@ imapx_parse_envelope (CamelIMAPXStream *is,
        tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
        if (tok != '(') {
                g_clear_error (&local_error);
-               camel_message_info_free (minfo);
+               camel_message_info_unref (minfo);
                g_set_error (error, CAMEL_IMAPX_ERROR, 1, "envelope: expecting '('");
                return NULL;
        }
@@ -1228,7 +1228,7 @@ imapx_parse_envelope (CamelIMAPXStream *is,
        tok = camel_imapx_stream_token (is, &token, &len, cancellable, &local_error);
        if (tok != ')') {
                g_clear_error (&local_error);
-               camel_message_info_free (minfo);
+               camel_message_info_unref (minfo);
                g_set_error (error, CAMEL_IMAPX_ERROR, 1, "expecting ')'");
                return NULL;
        }
@@ -1335,7 +1335,7 @@ imapx_parse_body (CamelIMAPXStream *is,
                        minfo = imapx_parse_envelope (is, cancellable, &local_error);
                        /* what do we do with the message content info?? */
                        //((CamelMessageInfoBase *) minfo)->content = imapx_parse_body (is);
-                       camel_message_info_free (minfo);
+                       camel_message_info_unref (minfo);
                        minfo = NULL;
                        d (is->tagprefix, "Scanned envelope - what do i do with it?\n");
                }
@@ -1519,7 +1519,7 @@ imapx_free_fetch (struct _fetch_info *finfo)
        if (finfo->header)
                g_object_unref (finfo->header);
        if (finfo->minfo)
-               camel_message_info_free (finfo->minfo);
+               camel_message_info_unref (finfo->minfo);
        if (finfo->cinfo)
                imapx_free_body (finfo->cinfo);
        camel_flag_list_free (&finfo->user_flags);
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 1e870d5..0fa0ff4 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -150,7 +150,7 @@ vee_folder_note_added_uid (CamelVeeFolder *vfolder,
                if (vmi) {
                        if (changes)
                                camel_folder_change_info_add_uid (changes, vuid);
-                       camel_message_info_free (vmi);
+                       camel_message_info_unref (vmi);
 
                        if (vfolder->priv->parent_vee_store)
                                camel_vee_store_note_vuid_used (vfolder->priv->parent_vee_store, 
added_mi_data, vfolder);
@@ -880,7 +880,7 @@ vee_folder_get_message_sync (CamelFolder *folder,
                msg = camel_folder_get_message_sync (
                        camel_folder_summary_get_folder (mi->orig_summary), camel_message_info_uid (mi) + 8,
                        cancellable, error);
-               camel_message_info_free ((CamelMessageInfo *) mi);
+               camel_message_info_unref (mi);
        } else {
                g_set_error (
                        error, CAMEL_FOLDER_ERROR,
diff --git a/camel/camel-vee-summary.c b/camel/camel-vee-summary.c
index 4b56ef3..b825112 100644
--- a/camel/camel-vee-summary.c
+++ b/camel/camel-vee-summary.c
@@ -92,7 +92,7 @@ vee_info_ptr (const CamelMessageInfo *mi,
        rmi = camel_folder_summary_get (vmi->orig_summary, mi->uid + 8);
        HANDLE_NULL_INFO (NULL);
        p = (gpointer) camel_message_info_ptr (rmi, id);
-       camel_message_info_free (rmi);
+       camel_message_info_unref (rmi);
 
        return p;
 }
@@ -106,7 +106,7 @@ vee_info_uint32 (const CamelMessageInfo *mi,
 
        HANDLE_NULL_INFO (0);
        ret = camel_message_info_uint32 (rmi, id);
-       camel_message_info_free (rmi);
+       camel_message_info_unref (rmi);
 
        return ret;
 
@@ -121,7 +121,7 @@ vee_info_time (const CamelMessageInfo *mi,
 
        HANDLE_NULL_INFO (0);
        ret = camel_message_info_time (rmi, id);
-       camel_message_info_free (rmi);
+       camel_message_info_unref (rmi);
 
        return ret;
 }
@@ -135,7 +135,7 @@ vee_info_user_flag (const CamelMessageInfo *mi,
 
        HANDLE_NULL_INFO (FALSE);
        ret =   camel_message_info_user_flag (rmi, id);
-       camel_message_info_free (rmi);
+       camel_message_info_unref (rmi);
 
        return ret;
 }
@@ -149,7 +149,7 @@ vee_info_user_tag (const CamelMessageInfo *mi,
 
        HANDLE_NULL_INFO ("");
        ret = camel_message_info_user_tag (rmi, id);
-       camel_message_info_free (rmi);
+       camel_message_info_unref (rmi);
 
        return ret;
 }
@@ -191,7 +191,7 @@ vee_info_set_user_flag (CamelMessageInfo *mi,
 
                res = camel_message_info_set_user_flag (rmi, name, value);
 
-               camel_message_info_free (rmi);
+               camel_message_info_unref (rmi);
 
                if (ignore_changes)
                        vee_summary_notify_mi_changed (vf, mi);
@@ -220,7 +220,7 @@ vee_info_set_user_tag (CamelMessageInfo *mi,
                        camel_vee_folder_ignore_next_changed_event (vf, camel_folder_summary_get_folder 
(rmi->summary));
 
                res = camel_message_info_set_user_tag (rmi, name, value);
-               camel_message_info_free (rmi);
+               camel_message_info_unref (rmi);
 
                if (ignore_changes)
                        vee_summary_notify_mi_changed (vf, mi);
@@ -258,7 +258,7 @@ vee_info_set_flags (CamelMessageInfo *mi,
                        camel_folder_summary_replace_flags (mi->summary, mi);
                }
 
-               camel_message_info_free (rmi);
+               camel_message_info_unref (rmi);
 
                if (ignore_changes)
                        vee_summary_notify_mi_changed (vf, mi);
@@ -437,7 +437,7 @@ camel_vee_summary_get_uids_for_subfolder (CamelVeeSummary *summary,
        return known_uids;
 }
 
-/* free returned pointer with camel_message_info_free() */
+/* unref returned pointer with camel_message_info_unref() */
 CamelVeeMessageInfo *
 camel_vee_summary_add (CamelVeeSummary *s,
                        CamelVeeMessageInfoData *mi_data)
@@ -525,8 +525,8 @@ camel_vee_summary_remove (CamelVeeSummary *summary,
        if (mi) {
                /* under twice, the first for camel_folder_summary_peek_loaded(),
                 * the second to actually free the mi */
-               camel_message_info_free (mi);
-               camel_message_info_free (mi);
+               camel_message_info_unref (mi);
+               camel_message_info_unref (mi);
        }
 
        camel_folder_summary_unlock (&summary->summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -561,7 +561,7 @@ camel_vee_summary_replace_flags (CamelVeeSummary *summary,
        }
 
        camel_folder_summary_replace_flags (&summary->summary, mi);
-       camel_message_info_free (mi);
+       camel_message_info_unref (mi);
 
        camel_folder_summary_unlock (&summary->summary, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
 }
diff --git a/camel/providers/local/camel-local-summary.c b/camel/providers/local/camel-local-summary.c
index 0ee829f..0b84dc8 100644
--- a/camel/providers/local/camel-local-summary.c
+++ b/camel/providers/local/camel-local-summary.c
@@ -319,7 +319,7 @@ camel_local_summary_check (CamelLocalSummary *cls,
                for (i = 0; i < camel_folder_summary_count (s); i++) {
                        CamelMessageInfo *info = camel_folder_summary_get (s, g_ptr_array_index (known_uids, 
i));
                        do_stat_mi (cls, &stats, info);
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                }
                camel_folder_summary_free_array (known_uids);
 
diff --git a/camel/providers/local/camel-maildir-folder.c b/camel/providers/local/camel-maildir-folder.c
index 2bd0930..d62d1ed 100644
--- a/camel/providers/local/camel-maildir-folder.c
+++ b/camel/providers/local/camel-maildir-folder.c
@@ -63,8 +63,8 @@ maildir_folder_cmp_uids (CamelFolder *folder,
        tma = camel_message_info_date_received (a);
        tmb = camel_message_info_date_received (b);
 
-       camel_message_info_free (a);
-       camel_message_info_free (b);
+       camel_message_info_unref (a);
+       camel_message_info_unref (b);
 
        return tma < tmb ? -1 : tma == tmb ? 0 : 1;
 }
@@ -140,7 +140,7 @@ maildir_folder_get_filename (CamelFolder *folder,
 
        res = g_strdup_printf ("%s/cur/%s", lf->folder_path, camel_maildir_info_filename (mdi));
 
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 
        return res;
 }
@@ -352,7 +352,7 @@ maildir_folder_transfer_messages_to_sync (CamelFolder *source,
                                                g_io_error_from_errno (errno),
                                                _("Cannot transfer message to destination folder: %s"),
                                                g_strerror (errno));
-                                       camel_message_info_free (info);
+                                       camel_message_info_unref (info);
                                        g_free (s_filename);
                                        g_free (d_filename);
                                        g_free (new_filename);
@@ -386,7 +386,7 @@ maildir_folder_transfer_messages_to_sync (CamelFolder *source,
                                camel_folder_summary_remove (source->summary, info);
                        }
 
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                        g_free (s_filename);
                        g_free (d_filename);
                        g_free (new_filename);
diff --git a/camel/providers/local/camel-maildir-summary.c b/camel/providers/local/camel-maildir-summary.c
index 7b4d97d..367e37d 100644
--- a/camel/providers/local/camel-maildir-summary.c
+++ b/camel/providers/local/camel-maildir-summary.c
@@ -317,7 +317,7 @@ message_info_new_from_header (CamelFolderSummary *s,
                info = camel_folder_summary_peek_loaded (s, uid);
                if (info) {
                        d (printf ("already seen uid '%s', just summarising instead\n", uid));
-                       camel_message_info_free (mi);
+                       camel_message_info_unref (mi);
                        mdi = (CamelMaildirMessageInfo *)(mi = info);
                }
 
@@ -555,7 +555,7 @@ remove_summary (gchar *key,
        if (rd->changes)
                camel_folder_change_info_remove_uid (rd->changes, key);
        camel_folder_summary_remove ((CamelFolderSummary *) rd->cls, info);
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 }
 
 static gint
@@ -643,7 +643,7 @@ maildir_summary_check (CamelLocalSummary *cls,
 
                info = g_hash_table_lookup (left, uid);
                if (info) {
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                        g_hash_table_remove (left, uid);
                }
 
@@ -668,7 +668,7 @@ maildir_summary_check (CamelLocalSummary *cls,
                                g_free (mdi->filename);
                                mdi->filename = g_strdup (d->d_name);
                        }
-                       camel_message_info_free (info);
+                       camel_message_info_unref (info);
                }
                g_free (uid);
        }
@@ -704,7 +704,7 @@ maildir_summary_check (CamelLocalSummary *cls,
 
                        /* already in summary?  shouldn't happen, but just incase ... */
                        if ((info = camel_folder_summary_get ((CamelFolderSummary *) cls, name))) {
-                               camel_message_info_free (info);
+                               camel_message_info_unref (info);
                                newname = destname = camel_folder_summary_next_uid_string (s);
                        } else {
                                gchar *nm;
@@ -827,7 +827,7 @@ maildir_summary_sync (CamelLocalSummary *cls,
                        /* strip FOLDER_MESSAGE_FLAGED, etc */
                        mdi->info.info.flags &= 0xffff;
                }
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
        }
 
        camel_folder_summary_free_array (known_uids);
diff --git a/camel/providers/local/camel-mbox-folder.c b/camel/providers/local/camel-mbox-folder.c
index b8e38c8..99a84f4 100644
--- a/camel/providers/local/camel-mbox-folder.c
+++ b/camel/providers/local/camel-mbox-folder.c
@@ -67,8 +67,8 @@ mbox_folder_cmp_uids (CamelFolder *folder,
 
        res = a->frompos < b->frompos ? -1 : a->frompos == b->frompos ? 0 : 1;
 
-       camel_message_info_free ((CamelMessageInfo *) a);
-       camel_message_info_free ((CamelMessageInfo *) b);
+       camel_message_info_unref (a);
+       camel_message_info_unref (b);
 
        return res;
 }
@@ -119,12 +119,12 @@ mbox_folder_get_filename (CamelFolder *folder,
        }
 
        if (info->frompos == -1) {
-               camel_message_info_free ((CamelMessageInfo *) info);
+               camel_message_info_unref (info);
                goto fail;
        }
 
        frompos = info->frompos;
-       camel_message_info_free ((CamelMessageInfo *) info);
+       camel_message_info_unref (info);
 
        filename = g_strdup_printf ("%s%s!%" PRId64, lf->folder_path, G_DIR_SEPARATOR_S, (gint64) frompos);
 
@@ -331,12 +331,12 @@ retry:
        }
 
        if (info->frompos == -1) {
-               camel_message_info_free ((CamelMessageInfo *) info);
+               camel_message_info_unref (info);
                goto fail;
        }
 
        frompos = info->frompos;
-       camel_message_info_free ((CamelMessageInfo *) info);
+       camel_message_info_unref (info);
 
        /* we use an fd instead of a normal stream here - the reason is subtle, camel_mime_part will cache
         * the whole message in memory if the stream is non-seekable (which it is when built from a parser
diff --git a/camel/providers/local/camel-mbox-summary.c b/camel/providers/local/camel-mbox-summary.c
index bbe04aa..e54390c 100644
--- a/camel/providers/local/camel-mbox-summary.c
+++ b/camel/providers/local/camel-mbox-summary.c
@@ -328,12 +328,12 @@ message_info_new_from_header (CamelFolderSummary *s,
                        if (info) {
                                if ((info->info.info.flags & CAMEL_MESSAGE_FOLDER_NOTSEEN)) {
                                        info->info.info.flags &= ~CAMEL_MESSAGE_FOLDER_NOTSEEN;
-                                       camel_message_info_free (mi);
+                                       camel_message_info_unref (mi);
                                        mi = info;
                                } else {
                                        add = 7;
                                        d (printf ("seen '%s' before, adding anew\n", uid));
-                                       camel_message_info_free (info);
+                                       camel_message_info_unref (info);
                                }
                        } else {
                                add = 2;
@@ -494,7 +494,7 @@ summary_update (CamelLocalSummary *cls,
                        mi->info.info.flags |= CAMEL_MESSAGE_FOLDER_NOTSEEN;
                else
                        mi->info.info.flags &= ~CAMEL_MESSAGE_FOLDER_NOTSEEN;
-               camel_message_info_free (mi);
+               camel_message_info_unref (mi);
        }
        camel_folder_summary_free_array (known_uids);
        mbs->changes = changeinfo;
@@ -534,7 +534,7 @@ summary_update (CamelLocalSummary *cls,
                }
 
                if (mi)
-                       camel_message_info_free (mi);
+                       camel_message_info_unref (mi);
        }
 
        if (known_uids)
@@ -608,7 +608,7 @@ mbox_summary_check (CamelLocalSummary *cls,
 
                        if (info) {
                                camel_folder_change_info_remove_uid (changes, camel_message_info_uid (info));
-                               camel_message_info_free (info);
+                               camel_message_info_unref (info);
                        }
                }
                camel_folder_summary_free_array (known_uids);
@@ -781,8 +781,8 @@ cms_sort_frompos (gconstpointer a,
                ret = -1;
        else
                ret = 0;
-       camel_message_info_free (info1);
-       camel_message_info_free (info2);
+       camel_message_info_unref (info1);
+       camel_message_info_unref (info2);
 
        return ret;
 
@@ -860,7 +860,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
                d (printf ("Checking message %s %08x\n", camel_message_info_uid (info), 
((CamelMessageInfoBase *) info)->flags));
 
                if ((info->info.info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED) == 0) {
-                       camel_message_info_free ((CamelMessageInfo *) info);
+                       camel_message_info_unref (info);
                        info = NULL;
                        continue;
                }
@@ -925,7 +925,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
 
                info->info.info.flags &= 0xffff;
                info->info.info.dirty = TRUE;
-               camel_message_info_free ((CamelMessageInfo *) info);
+               camel_message_info_unref (info);
                info = NULL;
        }
 
@@ -958,7 +958,7 @@ mbox_summary_sync_quick (CamelMboxSummary *mbs,
        if (mp)
                g_object_unref (mp);
        if (info)
-               camel_message_info_free ((CamelMessageInfo *) info);
+               camel_message_info_unref (info);
 
        camel_operation_pop_message (cancellable);
        camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
@@ -1005,7 +1005,7 @@ mbox_summary_sync (CamelLocalSummary *cls,
                        quick = FALSE;
                else
                        work |= (info->info.info.flags & CAMEL_MESSAGE_FOLDER_FLAGGED) != 0;
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
        }
 
        g_ptr_array_foreach (summary, (GFunc) camel_pstring_free, NULL);
@@ -1170,7 +1170,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
                        camel_folder_change_info_remove_uid (changeinfo, uid);
                        camel_folder_summary_remove (s, (CamelMessageInfo *) info);
                        del = g_list_prepend (del, (gpointer) camel_pstring_strdup (uid));
-                       camel_message_info_free ((CamelMessageInfo *) info);
+                       camel_message_info_unref (info);
                        info = NULL;
                        lastdel = TRUE;
                        touched = TRUE;
@@ -1252,7 +1252,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
                                (gint) camel_mime_parser_tell (mp),
                                (gint) camel_mime_parser_tell_start_from (mp)));
                        camel_mime_parser_unstep (mp);
-                       camel_message_info_free ((CamelMessageInfo *) info);
+                       camel_message_info_unref (info);
                        info = NULL;
                }
        }
@@ -1282,7 +1282,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
                                ((CamelMessageInfo *) info)->dirty = TRUE;
                                camel_folder_summary_touch (s);
                        }
-                       camel_message_info_free ((CamelMessageInfo *) info);
+                       camel_message_info_unref (info);
                        info = NULL;
                }
        }
@@ -1300,7 +1300,7 @@ camel_mbox_summary_sync_mbox (CamelMboxSummary *cls,
        g_object_unref (mp);
 
        if (info)
-               camel_message_info_free ((CamelMessageInfo *) info);
+               camel_message_info_unref (info);
 
        camel_folder_summary_free_array (known_uids);
        camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
diff --git a/camel/providers/local/camel-mh-folder.c b/camel/providers/local/camel-mh-folder.c
index 5424617..e05697d 100644
--- a/camel/providers/local/camel-mh-folder.c
+++ b/camel/providers/local/camel-mh-folder.c
@@ -161,7 +161,7 @@ mh_folder_get_message_sync (CamelFolder *folder,
        }
 
        /* we only need it to check the message exists */
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 
        name = g_strdup_printf ("%s/%s", lf->folder_path, uid);
        message_stream = camel_stream_fs_new_with_name (
diff --git a/camel/providers/local/camel-mh-summary.c b/camel/providers/local/camel-mh-summary.c
index 4c9a00c..363a841 100644
--- a/camel/providers/local/camel-mh-summary.c
+++ b/camel/providers/local/camel-mh-summary.c
@@ -201,7 +201,7 @@ remove_summary (gchar *key,
        if (cls->index)
                camel_index_delete_name (cls->index, camel_message_info_uid (info));
        camel_folder_summary_remove ((CamelFolderSummary *) cls, info);
-       camel_message_info_free (info);
+       camel_message_info_unref (info);
 }
 
 static gint
@@ -265,11 +265,11 @@ mh_summary_check (CamelLocalSummary *cls,
 
                                        if (old) {
                                                g_hash_table_remove (left, camel_message_info_uid (info));
-                                               camel_message_info_free (old);
+                                               camel_message_info_unref (old);
                                        }
 
                                        camel_folder_summary_remove ((CamelFolderSummary *) cls, info);
-                                       camel_message_info_free (info);
+                                       camel_message_info_unref (info);
                                }
                                camel_mh_summary_add (cls, d->d_name, forceindex, cancellable);
                        } else {
@@ -278,9 +278,9 @@ mh_summary_check (CamelLocalSummary *cls,
 
                                if (old) {
                                        g_hash_table_remove (left, uid);
-                                       camel_message_info_free (old);
+                                       camel_message_info_unref (old);
                                }
-                               camel_message_info_free (info);
+                               camel_message_info_unref (info);
                        }
                }
        }
@@ -341,7 +341,7 @@ mh_summary_sync (CamelLocalSummary *cls,
                } else if (info->info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV | CAMEL_MESSAGE_FOLDER_FLAGGED)) {
                        info->info.flags &= 0xffff;
                }
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
        }
 
        camel_folder_summary_free_array (known_uids);
diff --git a/camel/providers/local/camel-spool-summary.c b/camel/providers/local/camel-spool-summary.c
index 559bd11..3f0697b 100644
--- a/camel/providers/local/camel-spool-summary.c
+++ b/camel/providers/local/camel-spool-summary.c
@@ -337,7 +337,7 @@ spool_summary_check (CamelLocalSummary *cls,
                CamelMboxMessageInfo *info = (CamelMboxMessageInfo *) camel_folder_summary_get (s, 
g_ptr_array_index (known_uids, i));
                g_assert (info);
                work = (info->info.info.flags & (CAMEL_MESSAGE_FOLDER_NOXEV)) != 0;
-               camel_message_info_free ((CamelMessageInfo *) info);
+               camel_message_info_unref (info);
        }
        camel_folder_summary_free_array (known_uids);
 
diff --git a/camel/providers/nntp/camel-nntp-folder.c b/camel/providers/nntp/camel-nntp-folder.c
index 17ea4ce..d467a6a 100644
--- a/camel/providers/nntp/camel-nntp-folder.c
+++ b/camel/providers/nntp/camel-nntp-folder.c
@@ -227,7 +227,7 @@ unset_flagged_flag (const gchar *uid,
                        base->dirty = TRUE;
                }
 
-               camel_message_info_free (info);
+               camel_message_info_unref (info);
        }
 }
 
@@ -731,7 +731,7 @@ nntp_folder_expunge_uids_offline (CamelFolder *folder,
                CamelMessageInfo *mi = camel_folder_summary_peek_loaded (folder->summary, uids->pdata[ii]);
                if (mi) {
                        camel_folder_summary_remove (folder->summary, mi);
-                       camel_message_info_free (mi);
+                       camel_message_info_unref (mi);
                } else {
                        camel_folder_summary_remove_uid (folder->summary, uids->pdata[ii]);
                }
diff --git a/camel/providers/nntp/camel-nntp-summary.c b/camel/providers/nntp/camel-nntp-summary.c
index 5cba381..cb837e4 100644
--- a/camel/providers/nntp/camel-nntp-summary.c
+++ b/camel/providers/nntp/camel-nntp-summary.c
@@ -505,7 +505,7 @@ camel_nntp_summary_check (CamelNNTPSummary *cns,
                                        mi = camel_folder_summary_peek_loaded (s, uid);
                                        if (mi) {
                                                camel_folder_summary_remove (s, mi);
-                                               camel_message_info_free (mi);
+                                               camel_message_info_unref (mi);
                                        } else {
                                                camel_folder_summary_remove_uid (s, uid);
                                        }
diff --git a/docs/reference/camel/camel-sections.txt b/docs/reference/camel/camel-sections.txt
index 387256a..30d227c 100644
--- a/docs/reference/camel/camel-sections.txt
+++ b/docs/reference/camel/camel-sections.txt
@@ -640,7 +640,7 @@ camel_tag_list_free
 camel_message_info_new
 camel_message_info_ref
 camel_message_info_new_from_header
-camel_message_info_free
+camel_message_info_unref
 camel_message_info_clone
 camel_message_info_ptr
 camel_message_info_uint32


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]