adjusts an example to disable a single task before it runs out of iterations. the task disables itself. without the fix in TaskScheduler.h, one can observe a memory leak, as the task which disabled itself is not deleted.
the TaskScheduler is adjusted to check the self-destruct request flag of disabled tasks and to delete such tasks.
output of original example
Free mem=354580 No of tasks=0
No of tasks=0
Free mem=354580
output of modified example without fix:
Free mem=354572 No of tasks=0
No of tasks=0
Free mem=354488
output of modified example with fix:
Free mem=354572 No of tasks=0
No of tasks=0
Free mem=354572
adjusts an example to disable a single task before it runs out of iterations. the task disables itself. without the fix in
TaskScheduler.h
, one can observe a memory leak, as the task which disabled itself is not deleted.the TaskScheduler is adjusted to check the self-destruct request flag of disabled tasks and to delete such tasks.
output of original example
output of modified example without fix:
output of modified example with fix: