Piotr Caban (@piotr) commented about dlls/msvcrt/concurrency.c:
operator_delete(scheduler_cur); } }
- EnterCriticalSection(&this->scheduled_chores_cs);
- if (!list_empty(&this->scheduled_chores))
ERR("scheduled chore list is not empty\n");
This will crash if chore is executed after context is destroyed. I don't know how it's supposed to work but if it doesn't crash with native, I will prefer something along these lines (not tested): ```c if (!list_empty(&this->scheduled_chores)) FIXME("scheduled chores list is not empty\n"); while (!list_empty(&this->scheduled_chores)) { entry = list_head(&this->scheduled_chores); list_remove(entry); LeaveCriticalSection(&this->scheduled_chores_cs);
sc = LIST_ENTRY(entry, struct scheduled_chore, entry); chore = sc->chore; operator_delete(sc);
_StructuredTaskCollection_RunAndWait(chore->task_collection, chore); EnterCriticalSection(&this->scheduled_chores_cs); } ```
Unfortunately it may be tricky to test depending how context caching works (another option is to cancel the task collections). FWIW I think that incorrect solution is better than a crash.