lx_hybrid: Safety check when freeing thread

Try to free the metadata of a thread only if created by Genode. The code
did not cause any actual problems. I just stumbled over the inconsistency
while reviewing the code.
This commit is contained in:
Norman Feske 2013-05-03 14:35:07 +02:00
parent 09e04d6378
commit 0355591445
1 changed files with 6 additions and 1 deletions

View File

@ -450,7 +450,12 @@ Thread_base::~Thread_base()
ret, errno);
}
destroy(env()->heap(), _tid.meta_data);
Thread_meta_data_created *meta_data =
dynamic_cast<Thread_meta_data_created *>(_tid.meta_data);
if (meta_data)
destroy(env()->heap(), meta_data);
_tid.meta_data = 0;
/* inform core about the killed thread */