diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-16 14:58:47 +0100 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2014-04-17 14:22:30 +0100 |
commit | db40ad4e75885e5663a0c77a1595a52a8f7a2917 (patch) | |
tree | e26e55b48a450e4fdd7dfcc8a4cb6cf5520541e8 | |
parent | a0d8c3593b57ed99f58386acf2672cdf6099dd12 (diff) |
tp_dbus_connection_try_register_object: disallow GDBusObject-but-not-GDBusObjectSkeleton
-rw-r--r-- | telepathy-glib/dbus.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/telepathy-glib/dbus.c b/telepathy-glib/dbus.c index 35dc4ad52..7310afbfa 100644 --- a/telepathy-glib/dbus.c +++ b/telepathy-glib/dbus.c @@ -772,8 +772,12 @@ tp_dbus_connection_registration_free (gpointer p) * @object_path: an object path * @object: (type GObject.Object) (transfer none): an object to export * - * Export @object at @object_path. Its `TpSvc` interfaces will all - * be exported. + * Export @object at @object_path: + * + * * if it is a #GDBusObjectSkeleton, it will be exported + * * if it is a #GDBusObject but not a #GDBusObjectSkeleton, it is + * considered to be a programming error + * * otherwise, its `TpSvc` interfaces will all be exported * * It is considered to be a programming error to register an object * at a path where another object already exists. @@ -932,6 +936,13 @@ tp_dbus_connection_try_register_object (GDBusConnection *dbus_connection, g_return_val_if_fail (tp_dbus_check_valid_object_path (object_path, error), FALSE); g_return_val_if_fail (G_IS_OBJECT (object), FALSE); + /* If it implements GDBusObject then it must currently be a + * GDBusObjectSkeleton. The implementation doesn't actually assume that, + * as long as its interfaces are GDBusInterfaceSkeletons - we could + * relax this (to allow for objects that proxy a GDBusObjectSkeleton's + * interfaces, for instance) if needed. */ + g_return_val_if_fail (G_IS_DBUS_OBJECT_SKELETON (object) || + !G_IS_DBUS_OBJECT (object), FALSE); conn = dbus_connection; r = g_slice_new0 (Registration); |