fix tsched crashing when a process gets removed
when a process removes another process, the amount of processes tsched has decrements, but the for loop doesn't update. a check has been implemented to check for when the task that's getting looked up doesn't exist.
This commit is contained in:
@@ -105,7 +105,9 @@ local function runTasks()
|
|||||||
if not result then
|
if not result then
|
||||||
handleError(errorMessage)
|
handleError(errorMessage)
|
||||||
end
|
end
|
||||||
if coroutine.status(tsched.tasks[i].task) == "dead" then
|
if not tsched.tasks[i] then
|
||||||
|
log.kernel.warn("Attempted to update a non-existent task. This is likely because it was removed.")
|
||||||
|
elseif coroutine.status(tsched.tasks[i].task) == "dead" then
|
||||||
_PUBLIC.tsched.removeTask(tsched.tasks[i].id)
|
_PUBLIC.tsched.removeTask(tsched.tasks[i].id)
|
||||||
--ocelot.log("Removed coroutine")
|
--ocelot.log("Removed coroutine")
|
||||||
i = i - 1
|
i = i - 1
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
[37m[00:00:04:12] Debug!
|
|
||||||
[97m[00:00:04:19] Info!
|
|
||||||
[93m[00:00:04:25] Warning!
|
|
||||||
[91m[00:00:04:32] Error!
|
|
||||||
Reference in New Issue
Block a user