[PATCH] similar change to dbus_connection_unregister_object_path
simon.mcvittie at collabora.co.uk
Wed Oct 10 05:42:52 PDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
As per Thiago's comments, I suggest we loosen the API contract on
- From 9255fac48b6b042fbe537cd4a62168fb017f34ba Mon Sep 17 00:00:00 2001
From: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date: Wed, 10 Oct 2007 13:01:37 +0100
Subject: [PATCH] dbus_connection_unregister_object_path: Don't consider it to be a bug to unregister already-unregistered object paths.
dbus/dbus-connection.c | 5 ++++-
dbus/dbus-object-tree.c | 12 +++---------
2 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/dbus/dbus-connection.c b/dbus/dbus-connection.c
index e6848c1..d0a0863 100644
- --- a/dbus/dbus-connection.c
@@ -5459,9 +5459,12 @@ dbus_connection_register_fallback (DBusConnection *connection,
* Unregisters the handler registered with exactly the given path.
- - * It's a bug to call this function for a path that isn't registered.
+ * Calling this function for a path that isn't registered has no effect.
* Can unregister both fallback paths and object paths.
+ * @note In libdbus <= 1.1.2 it was considered to be a bug to unregister
+ * object paths that were not already registered.
* @param connection the connection
* @param path a '/' delimited string of path elements
* @returns #FALSE if not enough memory
diff --git a/dbus/dbus-object-tree.c b/dbus/dbus-object-tree.c
index 953aa3b..b079112 100644
- --- a/dbus/dbus-object-tree.c
@@ -433,7 +433,7 @@ _dbus_object_tree_register (DBusObjectTree *tree,
* Unregisters an object subtree that was registered with the
- - * same path.
+ * same path, if any.
* @param tree the global object tree
* @param path path to the subtree (same as the one passed to _dbus_object_tree_register())
@@ -455,17 +455,11 @@ _dbus_object_tree_unregister_and_unlock (DBusObjectTree *tree,
subtree = find_subtree (tree, path, &i);
- -#ifndef DBUS_DISABLE_CHECKS
if (subtree == NULL)
- - _dbus_warn ("Attempted to unregister path (path = %s path = %s) which isn't registered\n",
- - path ? path : "null",
- - path ? path : "null");
- - goto unlock;
+ /* there was nothing registered */
+ goto unlock;
- - _dbus_assert (subtree != NULL);
_dbus_assert (subtree->parent == NULL ||
(i >= 0 && subtree->parent->subtrees[i] == subtree));
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: OpenPGP key: http://www.pseudorandom.co.uk/2003/contact/ or pgp.net
-----END PGP SIGNATURE-----
More information about the dbus