dde_linux: free stack on task destruction

Issue #4575.
This commit is contained in:
Josef Söntgen 2022-07-21 15:56:22 +02:00 committed by Christian Helmuth
parent 8255053242
commit bc665384c3

View File

@ -41,6 +41,13 @@ static inline void * _alloc_stack(const char * name)
}
static inline void _free_stack(void *addr)
{
Genode::Thread * th = Genode::Thread::myself();
th->free_secondary_stack(addr);
}
Task::State Task::state() const { return _state; }
@ -152,4 +159,8 @@ Task::Task(int (* func)(void*),
}
Task::~Task() { _scheduler.remove(*this); }
Task::~Task()
{
_scheduler.remove(*this);
_free_stack(_stack);
}