core: avoid dangling ptr in cpu thread component

if exception is triggered during construction of a thread
This commit is contained in:
Alexander Boettcher 2019-12-17 13:25:11 +01:00 committed by Christian Helmuth
parent 33db0e0d4d
commit bcb7f45201
1 changed files with 1 additions and 2 deletions

View File

@ -152,8 +152,6 @@ class Genode::Cpu_thread_component : public Rpc_object<Cpu_thread>,
_platform_thread.affinity(),
pd.label(), name)
{
_address_space_region_map.add_client(_rm_client);
/*
* Acquaint thread with its pager object, caution on some base platforms
* this may raise an 'Out_of_ram' exception, which causes the
@ -167,6 +165,7 @@ class Genode::Cpu_thread_component : public Rpc_object<Cpu_thread>,
throw;
}
_address_space_region_map.add_client(_rm_client);
_platform_thread.pager(_rm_client);
_trace_sources.insert(&_trace_source);
}