All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/10] dbus: Send InterfacesRemoved on object unregister
@ 2016-02-15 16:44 Andrew Zaborowski
  2016-02-15 16:44 ` [PATCH 02/10] dbus: Error checking in l_dbus_property_changed Andrew Zaborowski
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Andrew Zaborowski @ 2016-02-15 16:44 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

Make sure we call _dbus_object_tree_remove_interface to do all the
necessary steps of interface removal when an object from the tree
together with its interfaces.
---
 ell/dbus-service.c | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/ell/dbus-service.c b/ell/dbus-service.c
index 1e3bb66..53e2512 100644
--- a/ell/dbus-service.c
+++ b/ell/dbus-service.c
@@ -733,13 +733,24 @@ bool _dbus_object_tree_object_destroy(struct _dbus_object_tree *tree,
 					const char *path)
 {
 	struct object_node *node;
+	const struct l_queue_entry *entry;
+	const struct interface_instance *instance;
 
-	node = l_hashmap_remove(tree->objects, path);
+	node = l_hashmap_lookup(tree->objects, path);
 	if (!node)
 		return false;
 
-	l_queue_destroy(node->instances,
-			(l_queue_destroy_func_t) interface_instance_free);
+	while ((entry = l_queue_get_entries(node->instances))) {
+		instance = entry->data;
+
+		if (!_dbus_object_tree_remove_interface(tree, path,
+						instance->interface->name))
+			return false;
+	}
+
+	l_hashmap_remove(tree->objects, path);
+
+	l_queue_destroy(node->instances, NULL);
 	node->instances = NULL;
 
 	if (node->destroy) {
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-02-18  3:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-15 16:44 [PATCH 01/10] dbus: Send InterfacesRemoved on object unregister Andrew Zaborowski
2016-02-15 16:44 ` [PATCH 02/10] dbus: Error checking in l_dbus_property_changed Andrew Zaborowski
2016-02-15 16:44 ` [PATCH 03/10] unit: More Dbus object tree sanity tests Andrew Zaborowski
2016-02-15 16:44 ` [PATCH 04/10] unit: DBus old-style property getter tests Andrew Zaborowski
2016-02-15 16:44 ` [PATCH 05/10] unit: DBus old-style property setter tests Andrew Zaborowski
2016-02-15 16:44 ` [PATCH 06/10] unit: org.freedesktop.DBus.Properties getter tests Andrew Zaborowski
2016-02-15 16:44 ` [PATCH 07/10] unit: org.freedesktop.DBus.Properties setter tests Andrew Zaborowski
2016-02-15 16:44 ` [PATCH 08/10] unit: Property change notifications signal tests Andrew Zaborowski
2016-02-15 16:44 ` [PATCH 09/10] unit: org.freedesktop.DBus.ObjectManager.GetManagedObject test Andrew Zaborowski
2016-02-18  3:50 ` [PATCH 01/10] dbus: Send InterfacesRemoved on object unregister Denis Kenzior

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.