mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-29 18:18:54 +00:00
base: apply thread.cc fix of foc to base*
With commit 1389b63050
in thread.cc for base-foc
a bug was fixed, where the memory of the context got freed up before running
the de-constructor.
Apply the fix also to base and base-mb.
This commit is contained in:
parent
1211516c08
commit
68156918ee
@ -164,9 +164,9 @@ void Thread_base::_free_context()
|
|||||||
{
|
{
|
||||||
addr_t ds_addr = _context->stack_base - Native_config::context_area_virtual_base();
|
addr_t ds_addr = _context->stack_base - Native_config::context_area_virtual_base();
|
||||||
Ram_dataspace_capability ds_cap = _context->ds_cap;
|
Ram_dataspace_capability ds_cap = _context->ds_cap;
|
||||||
|
_context_allocator()->free(this);
|
||||||
Genode::env_context_area_rm_session()->detach((void *)ds_addr);
|
Genode::env_context_area_rm_session()->detach((void *)ds_addr);
|
||||||
Genode::env_context_area_ram_session()->free(ds_cap);
|
Genode::env_context_area_ram_session()->free(ds_cap);
|
||||||
_context_allocator()->free(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -161,12 +161,11 @@ Thread_base::Context *Thread_base::_alloc_context(size_t stack_size)
|
|||||||
|
|
||||||
void Thread_base::_free_context()
|
void Thread_base::_free_context()
|
||||||
{
|
{
|
||||||
addr_t ds_addr = _context->stack_base -
|
addr_t ds_addr = _context->stack_base - Native_config::context_area_virtual_base();
|
||||||
Native_config::context_area_virtual_base();
|
|
||||||
Ram_dataspace_capability ds_cap = _context->ds_cap;
|
Ram_dataspace_capability ds_cap = _context->ds_cap;
|
||||||
|
_context_allocator()->free(this);
|
||||||
Genode::env_context_area_rm_session()->detach((void *)ds_addr);
|
Genode::env_context_area_rm_session()->detach((void *)ds_addr);
|
||||||
Genode::env_context_area_ram_session()->free(ds_cap);
|
Genode::env_context_area_ram_session()->free(ds_cap);
|
||||||
_context_allocator()->free(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user