[telepathy-mission-control/master] McdDispatcher: don't include finished CDOs in the DispatchOperations property

Simon McVittie simon.mcvittie at collabora.co.uk
Mon May 11 03:50:38 PDT 2009


Alberto's recent life-cycle bugfixing caused CDOs to remain referenced for
longer than they previously were, resulting in them remaining in the
DispatchOperations property even after they had finished. This caused
dispatcher/lose-text.py to fail.
---
 src/mcd-dispatch-operation-priv.h |    2 ++
 src/mcd-dispatch-operation.c      |   13 +++++++++++++
 src/mcd-dispatcher.c              |    3 ++-
 3 files changed, 17 insertions(+), 1 deletions(-)

diff --git a/src/mcd-dispatch-operation-priv.h b/src/mcd-dispatch-operation-priv.h
index 36b4fd0..cd0fe50 100644
--- a/src/mcd-dispatch-operation-priv.h
+++ b/src/mcd-dispatch-operation-priv.h
@@ -35,6 +35,8 @@ G_GNUC_INTERNAL void _mcd_dispatch_operation_lose_channel (
 
 G_GNUC_INTERNAL GPtrArray *_mcd_dispatch_operation_dup_channel_details (
     McdDispatchOperation *self);
+G_GNUC_INTERNAL gboolean _mcd_dispatch_operation_is_finished (
+    McdDispatchOperation *self);
 G_GNUC_INTERNAL void _mcd_dispatch_operation_block_finished (
     McdDispatchOperation *self);
 G_GNUC_INTERNAL void _mcd_dispatch_operation_unblock_finished (
diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 7a3ab06..1406e08 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -570,6 +570,19 @@ mcd_dispatch_operation_is_claimed (McdDispatchOperation *operation)
     return operation->priv->claimed;
 }
 
+/*
+ * _mcd_dispatch_operation_is_finished:
+ * @self: the #McdDispatchOperation.
+ *
+ * Returns: %TRUE if the operation has finished, %FALSE otherwise.
+ */
+gboolean
+_mcd_dispatch_operation_is_finished (McdDispatchOperation *self)
+{
+    g_return_val_if_fail (MCD_IS_DISPATCH_OPERATION (self), FALSE);
+    return self->priv->finished;
+}
+
 /**
  * mcd_dispatch_operation_get_handler:
  * @operation: the #McdDispatchOperation.
diff --git a/src/mcd-dispatcher.c b/src/mcd-dispatcher.c
index e090145..cc1db23 100644
--- a/src/mcd-dispatcher.c
+++ b/src/mcd-dispatcher.c
@@ -1517,7 +1517,8 @@ _mcd_dispatcher_get_property (GObject * obj, guint prop_id,
             {
                 McdDispatcherContext *context = iter->data;
 
-                if (context->operation != NULL)
+                if (context->operation != NULL &&
+                    !_mcd_dispatch_operation_is_finished (context->operation))
                 {
                     GValueArray *va = g_value_array_new (2);
 
-- 
1.5.6.5




More information about the telepathy-commits mailing list