aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-06-14 21:27:43 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-06-14 21:27:43 +0800
commit9aca198838a55891b4aa28d522e106e77a6c39fb (patch)
tree9c7cd8d8b4ef017c0013f06dac4cfc4b907d9c97 /mail
parentef54e65fb925d5b207b185ada8cefe396125b789 (diff)
downloadgsoc2013-evolution-9aca198838a55891b4aa28d522e106e77a6c39fb.tar
gsoc2013-evolution-9aca198838a55891b4aa28d522e106e77a6c39fb.tar.gz
gsoc2013-evolution-9aca198838a55891b4aa28d522e106e77a6c39fb.tar.bz2
gsoc2013-evolution-9aca198838a55891b4aa28d522e106e77a6c39fb.tar.lz
gsoc2013-evolution-9aca198838a55891b4aa28d522e106e77a6c39fb.tar.xz
gsoc2013-evolution-9aca198838a55891b4aa28d522e106e77a6c39fb.tar.zst
gsoc2013-evolution-9aca198838a55891b4aa28d522e106e77a6c39fb.zip
message_list_regen_done_cb: Fix a runtime warning.
Make sure we're using our own RegenData structure. Still clear the reference on the private structure if it matches what we get from our GSimpleAsyncResult. The idea is to ensure we have exclusive access to it so we don't have to worry about locking, etc.
Diffstat (limited to 'mail')
-rw-r--r--mail/message-list.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/mail/message-list.c b/mail/message-list.c
index ecd294251d..4977a97909 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -4717,29 +4717,30 @@ message_list_regen_done_cb (GObject *source_object,
message_list = MESSAGE_LIST (source_object);
simple = G_SIMPLE_ASYNC_RESULT (result);
+ regen_data = g_simple_async_result_get_op_res_gpointer (simple);
- /* Steal the MessageList's RegenData pointer.
- * We should have exclusive access to it now. */
+ /* Withdraw our RegenData from the private struct, if it hasn't
+ * already been replaced. We have exclusive access to it now. */
g_mutex_lock (&message_list->priv->regen_lock);
- regen_data = message_list->priv->regen_data;
- message_list->priv->regen_data = NULL;
+ if (message_list->priv->regen_data == regen_data) {
+ regen_data_unref (message_list->priv->regen_data);
+ message_list->priv->regen_data = NULL;
+ }
g_mutex_unlock (&message_list->priv->regen_lock);
- g_return_if_fail (regen_data != NULL);
-
activity = regen_data->activity;
g_simple_async_result_propagate_error (simple, &local_error);
if (e_activity_handle_cancellation (activity, local_error)) {
g_error_free (local_error);
- goto exit;
+ return;
/* FIXME This should be handed off to an EAlertSink. */
} else if (local_error != NULL) {
g_warning ("%s: %s", G_STRFUNC, local_error->message);
g_error_free (local_error);
- goto exit;
+ return;
}
e_activity_set_state (activity, E_ACTIVITY_COMPLETED);
@@ -4880,9 +4881,6 @@ message_list_regen_done_cb (GObject *source_object,
message_list_signals[MESSAGE_LIST_BUILT], 0);
message_list->priv->any_row_changed = FALSE;
-
-exit:
- regen_data_unref (regen_data);
}
static gboolean