Don't double decrease g_inCbCount.

Happened when a thread was deleted, it seems like.  Fixes #6542.
This commit is contained in:
Unknown W. Brackets committed 2014-07-12 09:57:13 -07:00
1 parent 88cfcf7e26
commit ef4847b6f5
2 files changed
+6 -3

No files matched your search

+3 -1
View File
@@ -3385,8 +3385,10 @@ void __KernelReturnFromMipsCall()
currentMIPS->r[MIPS_REG_V1] = call->savedV1;
cur->currentMipscallId = call->savedId;
if (call->cbId != 0)
// IF the thread called ExitDelete, we might've alreayd decreased g_inCbCount.
if (call->cbId != 0 && g_inCbCount > 0) {
g_inCbCount--;
}
currentCallbackThreadID = 0;
if (cur->nt.waitType != WAITTYPE_NONE)