sched: reset timer queue in finalization

Don't leave dangling pointers to timer queue entries when they are
freed in the scheduler finalization in case some code tried to remove
a timer later.

Fixes: 6ea1082a72 ("sched: free timer blocks on exit")
This commit is contained in:
Miroslav Lichvar 2023-06-19 16:10:45 +02:00
parent bc76291750
commit 6661a61486

View file

@ -163,6 +163,8 @@ SCH_Finalise(void) {
ARR_DestroyInstance(file_handlers); ARR_DestroyInstance(file_handlers);
timer_queue.next = &timer_queue;
timer_queue.prev = &timer_queue;
for (i = 0; i < ARR_GetSize(tqe_blocks); i++) for (i = 0; i < ARR_GetSize(tqe_blocks); i++)
Free(*(TimerQueueEntry **)ARR_GetElement(tqe_blocks, i)); Free(*(TimerQueueEntry **)ARR_GetElement(tqe_blocks, i));
ARR_DestroyInstance(tqe_blocks); ARR_DestroyInstance(tqe_blocks);