diff --git a/base-nova/src/base/server/server.cc b/base-nova/src/base/server/server.cc index 998e4d4d61..869134adfb 100644 --- a/base-nova/src/base/server/server.cc +++ b/base-nova/src/base/server/server.cc @@ -254,3 +254,17 @@ Rpc_entrypoint::Rpc_entrypoint(Cap_session *cap_session, size_t stack_size, if (start_on_construction) activate(); } + + +Rpc_entrypoint::~Rpc_entrypoint() +{ + typedef Object_pool Pool; + + if (Pool::first()) { + PWRN("Object pool not empty in %s", __func__); + + /* dissolve all objects - objects are not destroyed! */ + while (Rpc_object_base *obj = Pool::first()) + _dissolve(obj); + } +} diff --git a/base/include/base/rpc_server.h b/base/include/base/rpc_server.h index 68110c9f9f..6369b7efff 100644 --- a/base/include/base/rpc_server.h +++ b/base/include/base/rpc_server.h @@ -318,6 +318,8 @@ namespace Genode { Rpc_entrypoint(Cap_session *cap_session, size_t stack_size, char const *name, bool start_on_construction = true); + ~Rpc_entrypoint(); + /** * Associate RPC object with the entry point */ diff --git a/base/src/base/server/common.cc b/base/src/base/server/common.cc index 03b5c4f950..c7e52f2fa7 100644 --- a/base/src/base/server/common.cc +++ b/base/src/base/server/common.cc @@ -104,3 +104,19 @@ Rpc_entrypoint::Rpc_entrypoint(Cap_session *cap_session, size_t stack_size, if (start_on_construction) activate(); } + + +Rpc_entrypoint::~Rpc_entrypoint() +{ + typedef Object_pool Pool; + + if (Pool::first()) { + PWRN("Object pool not empty in %s", __func__); + + /* dissolve all objects - objects are not destroyed! */ + while (Rpc_object_base *obj = Pool::first()) + _dissolve(obj); + } + + _ipc_server->~Ipc_server(); +}