Permalink
Browse files

Kernel: Fix delete thread null check.

  • Loading branch information...
unknownbrackets committed Nov 25, 2017
1 parent bd1ed89 commit 9af0397e843707febc00a6a9dd6378ae990c5972
Showing with 12 additions and 9 deletions.
  1. +12 −9 Core/HLE/sceKernelThread.cpp
@@ -1648,18 +1648,21 @@ u32 __KernelDeleteThread(SceUID threadID, int exitStatus, const char *reason)
}
t->Cleanup();
}
// Before triggering, set v0. It'll be restored if one is called.
RETURN(error);
t->nt.status = THREADSTATUS_DEAD;
// Before triggering, set v0. It'll be restored if one is called.
RETURN(error);
t->nt.status = THREADSTATUS_DEAD;
if (__KernelThreadTriggerEvent((t->nt.attr & PSP_THREAD_ATTR_KERNEL) != 0, threadID, THREADEVENT_DELETE)) {
// Don't delete it yet. We'll delete later.
pendingDeleteThreads.push_back(threadID);
return 0;
if (__KernelThreadTriggerEvent((t->nt.attr & PSP_THREAD_ATTR_KERNEL) != 0, threadID, THREADEVENT_DELETE)) {
// Don't delete it yet. We'll delete later.
pendingDeleteThreads.push_back(threadID);
return 0;
} else {
return kernelObjects.Destroy<Thread>(threadID);
}
} else {
return kernelObjects.Destroy<Thread>(threadID);
RETURN(error);
return error;
}
}

0 comments on commit 9af0397

Please sign in to comment.