aboutsummaryrefslogtreecommitdiffstats
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
parentef54e65fb925d5b207b185ada8cefe396125b789 (diff)
downloadgsoc2013-evolution-9aca198838a55891b4aa28d522e106e77a6c39fb.tar.gz
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.
-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
an title='2021-02-16 07:13:11 +0800'>2021-02-161-3/+3 * Mark BROKEN on FreeBSD 13 and 14Antoine Brodin2021-02-011-0/+3 * Add USES=xorg USES=gl, ports categories eNiclas Zeising2019-11-051-1/+1 * editors/texmacs: remove QT4 option (Qt4 deprecation)Tobias C. Berner2019-03-161-18/+4 * Mark QT4 ports/functionality for removal on 2019-03-15Rene Ladan2018-12-021-2/+9 * Replace bsd.qt.mk by Uses/qt.mk and Uses/qt-dist.mkTobias C. Berner2018-06-291-2/+3 * For ports that are marked BROKEN on armv6, and also fail to build onMark Linimon2017-11-301-0/+1 * Mark some ports failing on armv6, for errors classified as "???".Mark Linimon2017-05-271-0/+2 * - Fix shebangsDmitry Marakasov2017-04-211-2/+4 * Get rid of QT_PREFIX in favour of PREFIX.Tobias C. Berner2016-12-191-1/+1