[evolution-data-server/wip/camel-more-gobject] Fix runtime issues/bugs after the move to GObject-based CamelMessageInfo
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/wip/camel-more-gobject] Fix runtime issues/bugs after the move to GObject-based CamelMessageInfo
- Date: Wed, 14 Sep 2016 15:47:13 +0000 (UTC)
commit 3435a328bfe2deca37e58cea8dcbfd16f1e9a1a1
Author: Milan Crha <mcrha redhat com>
Date: Wed Sep 14 17:45:30 2016 +0200
Fix runtime issues/bugs after the move to GObject-based CamelMessageInfo
This time the code does what it should do, +/- hidden (yet unknown) bugs.
camel/camel-folder-summary.c | 66 ++++++++++++++++++------------------
camel/camel-message-info-base.c | 13 ++++++-
camel/camel-message-info.c | 4 ++-
camel/camel-vee-folder.c | 32 +++++++++++++++--
camel/camel-vee-message-info.c | 72 +++++++++++++++++++-------------------
camel/camel-vee-store.c | 17 ++++++++-
6 files changed, 127 insertions(+), 77 deletions(-)
---
diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c
index fe4f80d..4ff7b14 100644
--- a/camel/camel-folder-summary.c
+++ b/camel/camel-folder-summary.c
@@ -1678,6 +1678,7 @@ camel_folder_summary_load_from_db (CamelFolderSummary *summary,
return ret == 0;
}
+/* Beware, it only borrows pointers from 'cols' here */
static void
mir_from_cols (CamelMIRecord *mir,
CamelFolderSummary *summary,
@@ -1694,76 +1695,76 @@ mir_from_cols (CamelMIRecord *mir,
switch (camel_db_get_column_ident (columns_hash, i, ncol, name)) {
case CAMEL_DB_COLUMN_UID:
- mir->uid = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->uid = cols[i];
break;
case CAMEL_DB_COLUMN_FLAGS:
- mir->flags = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
+ mir->flags = cols[i] ? g_ascii_strtoull (cols[i], NULL, 10) : 0;
break;
case CAMEL_DB_COLUMN_READ:
- mir->read = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE)) :
FALSE;
+ mir->read = (cols[i]) ? ( ((g_ascii_strtoull (cols[i], NULL, 10)) ? TRUE :
FALSE)) : FALSE;
break;
case CAMEL_DB_COLUMN_DELETED:
- mir->deleted = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE))
: FALSE;
+ mir->deleted = (cols[i]) ? ( ((g_ascii_strtoull (cols[i], NULL, 10)) ? TRUE :
FALSE)) : FALSE;
break;
case CAMEL_DB_COLUMN_REPLIED:
- mir->replied = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE))
: FALSE;
+ mir->replied = (cols[i]) ? ( ((g_ascii_strtoull (cols[i], NULL, 10)) ? TRUE :
FALSE)) : FALSE;
break;
case CAMEL_DB_COLUMN_IMPORTANT:
- mir->important = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE :
FALSE)) : FALSE;
+ mir->important = (cols[i]) ? ( ((g_ascii_strtoull (cols[i], NULL, 10)) ? TRUE
: FALSE)) : FALSE;
break;
case CAMEL_DB_COLUMN_JUNK:
- mir->junk = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE : FALSE)) :
FALSE;
+ mir->junk = (cols[i]) ? ( ((g_ascii_strtoull (cols[i], NULL, 10)) ? TRUE :
FALSE)) : FALSE;
break;
case CAMEL_DB_COLUMN_ATTACHMENT:
- mir->attachment = (cols[i]) ? ( ((strtoul (cols[i], NULL, 10)) ? TRUE :
FALSE)) : FALSE;
+ mir->attachment = (cols[i]) ? ( ((g_ascii_strtoull (cols[i], NULL, 10)) ?
TRUE : FALSE)) : FALSE;
break;
case CAMEL_DB_COLUMN_SIZE:
- mir->size = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
+ mir->size = cols[i] ? g_ascii_strtoull (cols[i], NULL, 10) : 0;
break;
case CAMEL_DB_COLUMN_DSENT:
- mir->dsent = cols[i] ? strtol (cols[i], NULL, 10) : 0;
+ mir->dsent = cols[i] ? g_ascii_strtoll (cols[i], NULL, 10) : 0;
break;
case CAMEL_DB_COLUMN_DRECEIVED:
- mir->dreceived = cols[i] ? strtol (cols[i], NULL, 10) : 0;
+ mir->dreceived = cols[i] ? g_ascii_strtoll (cols[i], NULL, 10) : 0;
break;
case CAMEL_DB_COLUMN_SUBJECT:
- mir->subject = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->subject = cols[i];
break;
case CAMEL_DB_COLUMN_MAIL_FROM:
- mir->from = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->from = cols[i];
break;
case CAMEL_DB_COLUMN_MAIL_TO:
- mir->to = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->to = cols[i];
break;
case CAMEL_DB_COLUMN_MAIL_CC:
- mir->cc = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->cc = cols[i];
break;
case CAMEL_DB_COLUMN_MLIST:
- mir->mlist = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->mlist = cols[i];
break;
case CAMEL_DB_COLUMN_FOLLOWUP_FLAG:
- mir->followup_flag = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->followup_flag = cols[i];
break;
case CAMEL_DB_COLUMN_FOLLOWUP_COMPLETED_ON:
- mir->followup_completed_on = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->followup_completed_on = cols[i];
break;
case CAMEL_DB_COLUMN_FOLLOWUP_DUE_BY:
- mir->followup_due_by = (gchar *) camel_pstring_strdup (cols[i]);
+ mir->followup_due_by = cols[i];
break;
case CAMEL_DB_COLUMN_PART:
- mir->part = g_strdup (cols[i]);
+ mir->part = cols[i];
break;
case CAMEL_DB_COLUMN_LABELS:
- mir->labels = g_strdup (cols[i]);
+ mir->labels = cols[i];
break;
case CAMEL_DB_COLUMN_USERTAGS:
- mir->usertags = g_strdup (cols[i]);
+ mir->usertags = cols[i];
break;
case CAMEL_DB_COLUMN_CINFO:
- mir->cinfo = g_strdup (cols[i]);
+ mir->cinfo = cols[i];
break;
case CAMEL_DB_COLUMN_BDATA:
- mir->bdata = g_strdup (cols[i]);
+ mir->bdata = cols[i];
break;
default:
g_warn_if_reached ();
@@ -1780,26 +1781,27 @@ camel_read_mir_callback (gpointer ref,
{
struct _db_pass_data *data = (struct _db_pass_data *) ref;
CamelFolderSummary *summary = data->summary;
- CamelMIRecord *mir;
+ CamelMIRecord mir;
CamelMessageInfo *info;
gchar *bdata_ptr;
gint ret = 0;
- mir = g_new0 (CamelMIRecord , 1);
- mir_from_cols (mir, summary, &data->columns_hash, ncol, cols, name);
+ memset (&mir, 0, sizeof (CamelMIRecord));
+
+ /* As mir_from_cols() only borrows data from cols, no need to free mir */
+ mir_from_cols (&mir, summary, &data->columns_hash, ncol, cols, name);
camel_folder_summary_lock (summary);
- if (!mir->uid || g_hash_table_lookup (summary->priv->loaded_infos, mir->uid)) {
+ if (!mir.uid || g_hash_table_lookup (summary->priv->loaded_infos, mir.uid)) {
/* Unlock and better return */
camel_folder_summary_unlock (summary);
- camel_db_camel_mir_free (mir);
return ret;
}
camel_folder_summary_unlock (summary);
info = camel_message_info_new (summary);
- bdata_ptr = mir->bdata;
- if (camel_message_info_load (info, mir, &bdata_ptr)) {
+ bdata_ptr = mir.bdata;
+ if (camel_message_info_load (info, &mir, &bdata_ptr)) {
/* Just now we are reading from the DB, it can't be dirty. */
camel_message_info_set_dirty (info, FALSE);
if (data->add)
@@ -1813,8 +1815,6 @@ camel_read_mir_callback (gpointer ref,
ret = -1;
}
- camel_db_camel_mir_free (mir);
-
return ret;
}
diff --git a/camel/camel-message-info-base.c b/camel/camel-message-info-base.c
index c766f52..ce8315e 100644
--- a/camel/camel-message-info-base.c
+++ b/camel/camel-message-info-base.c
@@ -96,7 +96,10 @@ message_info_base_get_user_flag (const CamelMessageInfo *mi,
bmi = CAMEL_MESSAGE_INFO_BASE (mi);
camel_message_info_property_lock (mi);
- result = camel_named_flags_contains (bmi->priv->user_flags, name);
+ if (bmi->priv->user_flags)
+ result = camel_named_flags_contains (bmi->priv->user_flags, name);
+ else
+ result = FALSE;
camel_message_info_property_unlock (mi);
return result;
@@ -205,7 +208,10 @@ message_info_base_get_user_tag (const CamelMessageInfo *mi,
bmi = CAMEL_MESSAGE_INFO_BASE (mi);
camel_message_info_property_lock (mi);
- result = camel_name_value_array_get_named (bmi->priv->user_tags, TRUE, name);
+ if (bmi->priv->user_tags)
+ result = camel_name_value_array_get_named (bmi->priv->user_tags, TRUE, name);
+ else
+ result = NULL;
camel_message_info_property_unlock (mi);
return result;
@@ -225,6 +231,9 @@ message_info_base_set_user_tag (CamelMessageInfo *mi,
bmi = CAMEL_MESSAGE_INFO_BASE (mi);
camel_message_info_property_lock (mi);
+ if (!bmi->priv->user_tags)
+ bmi->priv->user_tags = camel_name_value_array_new ();
+
if (value)
changed = camel_name_value_array_set_named (bmi->priv->user_tags, TRUE, name, value);
else
diff --git a/camel/camel-message-info.c b/camel/camel-message-info.c
index d8a930e..c4d4152 100644
--- a/camel/camel-message-info.c
+++ b/camel/camel-message-info.c
@@ -309,7 +309,7 @@ message_info_save (const CamelMessageInfo *mi,
record->part = g_string_free (tmp, FALSE);
tmp = g_string_new (NULL);
- user_flags = camel_message_info_dup_user_flags (mi);
+ user_flags = camel_message_info_get_user_flags (mi);
if (user_flags) {
guint ii, count;
@@ -1459,6 +1459,8 @@ camel_message_info_thaw_notifications (CamelMessageInfo *mi)
if (notify_folder)
camel_message_info_update_summary_and_folder (mi, notify_folder_with_counts);
+ } else {
+ camel_message_info_property_unlock (mi);
}
}
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index 1bc96e7..745b8a9 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -269,6 +269,10 @@ vee_folder_merge_matching (CamelVeeFolder *vfolder,
g_return_if_fail (vsummary != NULL);
data_cache = vee_folder_get_data_cache (vfolder);
+ /* It can be NULL on dispose of the CamelVeeStore */
+ if (!data_cache)
+ return;
+
for (ii = 0; ii < match->len; ii++) {
const gchar *uid = match->pdata[ii];
@@ -385,8 +389,12 @@ vee_folder_subfolder_changed (CamelVeeFolder *vfolder,
}
g_rec_mutex_unlock (&vfolder->priv->subfolder_lock);
- changes = camel_folder_change_info_new ();
data_cache = vee_folder_get_data_cache (vfolder);
+ /* It can be NULL on dispose of the CamelVeeStore */
+ if (!data_cache)
+ return;
+
+ changes = camel_folder_change_info_new ();
v_folder = CAMEL_FOLDER (vfolder);
vsummary = CAMEL_VEE_SUMMARY (v_folder->summary);
@@ -663,8 +671,15 @@ vee_folder_propagate_skipped_changes (CamelVeeFolder *vf)
CamelFolder *v_folder;
CamelVeeDataCache *data_cache;
- changes = camel_folder_change_info_new ();
data_cache = vee_folder_get_data_cache (vf);
+
+ /* It can be NULL on dispose of the CamelVeeStore */
+ if (!data_cache) {
+ g_rec_mutex_unlock (&vf->priv->changed_lock);
+ return;
+ }
+
+ changes = camel_folder_change_info_new ();
v_folder = CAMEL_FOLDER (vf);
vsummary = CAMEL_VEE_SUMMARY (v_folder->summary);
@@ -1079,6 +1094,14 @@ vee_folder_remove_folder (CamelVeeFolder *vfolder,
rud.changes = changes;
rud.is_orig_message_uid = FALSE;
+ /* It can be NULL on dispose of the CamelVeeStore */
+ if (!rud.data_cache) {
+ camel_folder_thaw (v_folder);
+ camel_folder_change_info_free (changes);
+ g_hash_table_destroy (uids);
+ return;
+ }
+
g_hash_table_foreach (uids, vee_folder_remove_unmatched_cb, &rud);
if (vee_folder_is_unmatched (vfolder) &&
@@ -1609,7 +1632,10 @@ camel_vee_folder_remove_vuid (CamelVeeFolder *vfolder,
vsummary = CAMEL_VEE_SUMMARY (CAMEL_FOLDER (vfolder)->summary);
data_cache = vee_folder_get_data_cache (vfolder);
- vee_folder_note_unmatch_uid (vfolder, vsummary, subfolder, data_cache, mi_data, changes);
+
+ /* It can be NULL on dispose of the CamelVeeStore */
+ if (data_cache)
+ vee_folder_note_unmatch_uid (vfolder, vsummary, subfolder, data_cache, mi_data, changes);
}
/**
diff --git a/camel/camel-vee-message-info.c b/camel/camel-vee-message-info.c
index 0d05d08..b0b3e0d 100644
--- a/camel/camel-vee-message-info.c
+++ b/camel/camel-vee-message-info.c
@@ -77,7 +77,7 @@ vee_message_info_notify_mi_changed (CamelFolder *folder,
camel_folder_change_info_free (changes);
}
-#define vee_call_from_parent_mi(_err_ret, _ret_type, _call_what, _call_args) G_STMT_START { \
+#define vee_call_from_parent_mi(_err_ret, _ret_type, _call_what, _call_args, _is_set) G_STMT_START { \
CamelVeeMessageInfo *vmi; \
CamelMessageInfo *orig_mi; \
CamelFolderSummary *this_summary, *sub_summary; \
@@ -113,7 +113,7 @@ vee_message_info_notify_mi_changed (CamelFolder *folder,
sub_summary = camel_message_info_ref_summary (orig_mi); \
sub_folder = sub_summary ? camel_folder_summary_get_folder (sub_summary) : NULL; \
\
- ignore_changes = !CAMEL_IS_VTRASH_FOLDER (this_folder); \
+ ignore_changes = _is_set && !CAMEL_IS_VTRASH_FOLDER (this_folder); \
\
/* ignore changes done in the folder itself, \
* unless it's a vTrash or vJunk folder */ \
@@ -141,7 +141,7 @@ vee_message_info_notify_mi_changed (CamelFolder *folder,
static guint32
vee_message_info_get_flags (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (0, guint32, camel_message_info_get_flags, (orig_mi));
+ vee_call_from_parent_mi (0, guint32, camel_message_info_get_flags, (orig_mi), FALSE);
}
static gboolean
@@ -149,7 +149,7 @@ vee_message_info_set_flags_real (CamelMessageInfo *mi,
guint32 mask,
guint32 set)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_flags, (orig_mi, mask, set));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_flags, (orig_mi, mask, set), TRUE);
}
static gboolean
@@ -177,7 +177,7 @@ static gboolean
vee_message_info_get_user_flag (const CamelMessageInfo *mi,
const gchar *name)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_get_user_flag, (orig_mi, name));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_get_user_flag, (orig_mi, name), FALSE);
}
static gboolean
@@ -185,33 +185,33 @@ vee_message_info_set_user_flag (CamelMessageInfo *mi,
const gchar *name,
gboolean state)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_user_flag, (orig_mi, name, state));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_user_flag, (orig_mi, name, state),
TRUE);
}
static const CamelNamedFlags *
vee_message_info_get_user_flags (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const CamelNamedFlags *, camel_message_info_get_user_flags, (orig_mi));
+ vee_call_from_parent_mi (NULL, const CamelNamedFlags *, camel_message_info_get_user_flags, (orig_mi),
FALSE);
}
static CamelNamedFlags *
vee_message_info_dup_user_flags (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, CamelNamedFlags *, camel_message_info_dup_user_flags, (orig_mi));
+ vee_call_from_parent_mi (NULL, CamelNamedFlags *, camel_message_info_dup_user_flags, (orig_mi),
FALSE);
}
static gboolean
vee_message_info_take_user_flags (CamelMessageInfo *mi,
CamelNamedFlags *user_flags)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_take_user_flags, (orig_mi, user_flags));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_take_user_flags, (orig_mi, user_flags),
TRUE);
}
static const gchar *
vee_message_info_get_user_tag (const CamelMessageInfo *mi,
const gchar *name)
{
- vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_user_tag, (orig_mi, name));
+ vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_user_tag, (orig_mi, name),
FALSE);
}
static gboolean
@@ -219,169 +219,169 @@ vee_message_info_set_user_tag (CamelMessageInfo *mi,
const gchar *name,
const gchar *value)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_user_tag, (orig_mi, name, value));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_user_tag, (orig_mi, name, value),
TRUE);
}
static CamelNameValueArray *
vee_message_info_dup_user_tags (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, CamelNameValueArray *, camel_message_info_dup_user_tags, (orig_mi));
+ vee_call_from_parent_mi (NULL, CamelNameValueArray *, camel_message_info_dup_user_tags, (orig_mi),
FALSE);
}
static const CamelNameValueArray *
vee_message_info_get_user_tags (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const CamelNameValueArray *, camel_message_info_get_user_tags,
(orig_mi));
+ vee_call_from_parent_mi (NULL, const CamelNameValueArray *, camel_message_info_get_user_tags,
(orig_mi), FALSE);
}
static gboolean
vee_message_info_take_user_tags (CamelMessageInfo *mi,
CamelNameValueArray *user_tags)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_take_user_tags, (orig_mi, user_tags));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_take_user_tags, (orig_mi, user_tags),
TRUE);
}
static const gchar *
vee_message_info_get_subject (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_subject, (orig_mi));
+ vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_subject, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_subject (CamelMessageInfo *mi,
const gchar *subject)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_subject, (orig_mi, subject));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_subject, (orig_mi, subject), TRUE);
}
static const gchar *
vee_message_info_get_from (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_from, (orig_mi));
+ vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_from, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_from (CamelMessageInfo *mi,
const gchar *from)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_from, (orig_mi, from));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_from, (orig_mi, from), TRUE);
}
static const gchar *
vee_message_info_get_to (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_to, (orig_mi));
+ vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_to, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_to (CamelMessageInfo *mi,
const gchar *to)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_to, (orig_mi, to));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_to, (orig_mi, to), TRUE);
}
static const gchar *
vee_message_info_get_cc (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_cc, (orig_mi));
+ vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_cc, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_cc (CamelMessageInfo *mi,
const gchar *cc)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_cc, (orig_mi, cc));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_cc, (orig_mi, cc), TRUE);
}
static const gchar *
vee_message_info_get_mlist (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_mlist, (orig_mi));
+ vee_call_from_parent_mi (NULL, const gchar *, camel_message_info_get_mlist, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_mlist (CamelMessageInfo *mi,
const gchar *mlist)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_mlist, (orig_mi, mlist));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_mlist, (orig_mi, mlist), TRUE);
}
static guint32
vee_message_info_get_size (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (0, guint32, camel_message_info_get_size, (orig_mi));
+ vee_call_from_parent_mi (0, guint32, camel_message_info_get_size, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_size (CamelMessageInfo *mi,
guint32 size)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_size, (orig_mi, size));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_size, (orig_mi, size), TRUE);
}
static gint64
vee_message_info_get_date_sent (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (0, gint64, camel_message_info_get_date_sent, (orig_mi));
+ vee_call_from_parent_mi (0, gint64, camel_message_info_get_date_sent, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_date_sent (CamelMessageInfo *mi,
gint64 date_sent)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_date_sent, (orig_mi, date_sent));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_date_sent, (orig_mi, date_sent),
TRUE);
}
static gint64
vee_message_info_get_date_received (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (0, gint64, camel_message_info_get_date_received, (orig_mi));
+ vee_call_from_parent_mi (0, gint64, camel_message_info_get_date_received, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_date_received (CamelMessageInfo *mi,
gint64 date_received)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_date_received, (orig_mi,
date_received));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_date_received, (orig_mi,
date_received), TRUE);
}
static guint64
vee_message_info_get_message_id (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (0, guint64, camel_message_info_get_message_id, (orig_mi));
+ vee_call_from_parent_mi (0, guint64, camel_message_info_get_message_id, (orig_mi), FALSE);
}
static gboolean
vee_message_info_set_message_id (CamelMessageInfo *mi,
guint64 message_id)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_message_id, (orig_mi, message_id));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_set_message_id, (orig_mi, message_id),
TRUE);
}
static const GArray *
vee_message_info_get_references (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const GArray *, camel_message_info_get_references, (orig_mi));
+ vee_call_from_parent_mi (NULL, const GArray *, camel_message_info_get_references, (orig_mi), FALSE);
}
static gboolean
vee_message_info_take_references (CamelMessageInfo *mi,
GArray *references)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_take_references, (orig_mi, references));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_take_references, (orig_mi, references),
TRUE);
}
static const CamelNameValueArray *
vee_message_info_get_headers (const CamelMessageInfo *mi)
{
- vee_call_from_parent_mi (NULL, const CamelNameValueArray *, camel_message_info_get_headers,
(orig_mi));
+ vee_call_from_parent_mi (NULL, const CamelNameValueArray *, camel_message_info_get_headers,
(orig_mi), FALSE);
}
static gboolean
vee_message_info_take_headers (CamelMessageInfo *mi,
CamelNameValueArray *headers)
{
- vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_take_headers, (orig_mi, headers));
+ vee_call_from_parent_mi (FALSE, gboolean, camel_message_info_take_headers, (orig_mi, headers), TRUE);
}
#undef vee_call_from_parent_mi
diff --git a/camel/camel-vee-store.c b/camel/camel-vee-store.c
index 97511cc..93697ba 100644
--- a/camel/camel-vee-store.c
+++ b/camel/camel-vee-store.c
@@ -149,14 +149,26 @@ vee_store_get_property (GObject *object,
}
static void
+vee_store_dispose (GObject *object)
+{
+ CamelVeeStorePrivate *priv;
+
+ priv = CAMEL_VEE_STORE_GET_PRIVATE (object);
+
+ g_clear_object (&priv->vee_data_cache);
+ g_clear_object (&priv->unmatched_folder);
+
+ /* Chain up to parent's method. */
+ G_OBJECT_CLASS (camel_vee_store_parent_class)->dispose (object);
+}
+
+static void
vee_store_finalize (GObject *object)
{
CamelVeeStorePrivate *priv;
priv = CAMEL_VEE_STORE_GET_PRIVATE (object);
- g_object_unref (priv->unmatched_folder);
- g_object_unref (priv->vee_data_cache);
g_hash_table_destroy (priv->subfolder_usage_counts);
g_hash_table_destroy (priv->vuid_usage_counts);
g_mutex_clear (&priv->sf_counts_mutex);
@@ -510,6 +522,7 @@ camel_vee_store_class_init (CamelVeeStoreClass *class)
object_class = G_OBJECT_CLASS (class);
object_class->set_property = vee_store_set_property;
object_class->get_property = vee_store_get_property;
+ object_class->dispose = vee_store_dispose;
object_class->finalize = vee_store_finalize;
object_class->constructed = vee_store_constructed;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]