mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-19 19:26:29 +00:00
Loader: Free entries of parent-service registry
The parent-service registry is populated on demand by the 'Loader::Child' whenever a prior unknown service is requested. Since the number of parent services is limited, we expect the registry to settle after a while. However, each loader session has a private instance of a parent-service registry. So when creating and destroying loader sessions, parent registries will be populated again and again. We have to make sure to discard the entries along with the destruction of a loader session to avoid the leakage of memory. Issue #717
This commit is contained in:
parent
0355591445
commit
cc5fddb0a2
@ -260,6 +260,15 @@ namespace Loader {
|
||||
{
|
||||
if (_child)
|
||||
destroy(&_md_alloc, _child);
|
||||
|
||||
/*
|
||||
* The parent-service registry is populated by the 'Child'
|
||||
* on demand. Revert those allocations.
|
||||
*/
|
||||
while (Service *service = _parent_services.find_by_server(0)) {
|
||||
_parent_services.remove(service);
|
||||
destroy(env()->heap(), service);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user