From d472fddb618508fc86298b59555cb0082b0181f3 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 4 May 2023 22:42:14 +0300 Subject: [PATCH] Check if the thread pointer is valid before accessing it's data --- Tasking/Task.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Tasking/Task.cpp b/Tasking/Task.cpp index 49e81e5..9e204d6 100644 --- a/Tasking/Task.cpp +++ b/Tasking/Task.cpp @@ -167,8 +167,9 @@ namespace Tasking else { foreach (TCB *thread in Process->Threads) - if (thread->Status == Terminated) - RemoveThread(thread); + if (!InvalidTCB(thread)) + if (thread->Status == Terminated) + RemoveThread(thread); } }