summaryrefslogtreecommitdiff
path: root/camel
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-10-07 12:27:52 -0400
committerMatthew Barnes <mbarnes@redhat.com>2010-10-07 12:30:49 -0400
commit0cfa295313253f721810ede126fd9e09deb46c46 (patch)
tree58fc65a808ad82dd6372dec04abb625c5bd3ff81 /camel
parent22159c900cd89fb75c168df9b7038ea31ccf2fc2 (diff)
downloadevolution-data-server-0cfa295313253f721810ede126fd9e09deb46c46.tar.gz
CamelOperation: Try to avoid crashing on refcount errors.
Sanity check the StatusNode passed to the idle callback so that we emit a runtime warning rather than crash if the CamelOperation has already been finalized.
Diffstat (limited to 'camel')
-rw-r--r--camel/camel-operation.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/camel/camel-operation.c b/camel/camel-operation.c
index 926dbd41c..88ee3e52c 100644
--- a/camel/camel-operation.c
+++ b/camel/camel-operation.c
@@ -90,6 +90,10 @@ operation_emit_status_cb (StatusNode *node)
gchar *message = NULL;
gint percent = 0;
+ /* Guard against reference counting errors. */
+ g_return_val_if_fail (node != NULL, FALSE);
+ g_return_val_if_fail (CAMEL_IS_OPERATION (node->operation), FALSE);
+
/* Keep the operation alive until we emit the signal,
* otherwise it might be finalized between unlocking
* the mutex and emitting the signal. */