13 Jun
2023
13 Jun
'23
6:48 a.m.
Huw Davies (@huw) commented about dlls/sapi/async.c:
+ LeaveCriticalSection(&queue->cs); + + return task; +} + +void async_empty_queue(struct async_queue *queue) +{ + struct list *ptr; + + EnterCriticalSection(&queue->cs); + while ((ptr = list_head(&queue->tasks))) + { + struct async_task *task = LIST_ENTRY(ptr, struct async_task, entry); + list_remove(&task->entry); + heap_free(task); + } We have `LIST_FOR_EACH_ENTRY_SAFE()` which is designed for this sort of thing.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3052#note_35575