From e5ea660e2e9643fb5e72d3d06464d0f776578b3d Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Wed, 18 Sep 2013 13:16:17 +0200 Subject: [PATCH] hw: enable to destruct thread after its RM client ref #589 --- base-hw/src/core/platform_thread.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/base-hw/src/core/platform_thread.cc b/base-hw/src/core/platform_thread.cc index 2750f55e98..48b1d848fd 100644 --- a/base-hw/src/core/platform_thread.cc +++ b/base-hw/src/core/platform_thread.cc @@ -42,9 +42,12 @@ Platform_thread::~Platform_thread() { /* detach UTCB */ if (!_attaches_utcb_by_itself()) { - assert(_rm_client); - Rm_session_component * const rm = _rm_client->member_rm_session(); - rm->detach(_virt_utcb); + + /* the RM client may be destructed before platform thread */ + if (_rm_client) { + Rm_session_component * const rm = _rm_client->member_rm_session(); + rm->detach(_virt_utcb); + } } /* free UTCB */ if (_pd_id == Kernel::core_id()) {