diff --git a/os/include/init/child.h b/os/include/init/child.h index 6e741c948..ed0f1f936 100644 --- a/os/include/init/child.h +++ b/os/include/init/child.h @@ -557,7 +557,12 @@ namespace Init { } catch (Xml_node::Nonexistent_sub_node) { } } - virtual ~Child() { } + virtual ~Child() { + Genode::Service *s; + while ((s = _child_services->find_by_server(&_server))) { + _child_services->remove(s); + } + } /** * Return true if the child has the specified name