[telepathy-mission-control/master] McdDispatchOperation: assert that we don't set dbus-daemon twice

Simon McVittie simon.mcvittie at collabora.co.uk
Wed May 20 02:41:08 PDT 2009


dbus-daemon is a construct-only property, so setting it twice would be a
bug.

(Spotted via lcov.)
---
 src/mcd-dispatch-operation.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 7e74de0..61eeb42 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -346,8 +346,7 @@ mcd_dispatch_operation_set_property (GObject *obj, guint prop_id,
     switch (prop_id)
     {
     case PROP_DBUS_DAEMON:
-        if (priv->dbus_daemon)
-            g_object_unref (priv->dbus_daemon);
+        g_assert (priv->dbus_daemon == NULL);
         priv->dbus_daemon = TP_DBUS_DAEMON (g_value_dup_object (val));
         break;
 
-- 
1.5.6.5



More information about the telepathy-commits mailing list