Esme Povirk (@madewokherd) commented about dlls/uiautomationcore/uia_client.c:
CoDecrementMTAUsage(client_thread.mta_cookie);
memset(&client_thread, 0, sizeof(client_thread));
}
- }
- LeaveCriticalSection(&client_thread_cs);
- return started;
+}
+static void uia_stop_client_thread(void) +{
- EnterCriticalSection(&client_thread_cs);
- if (!--client_thread.ref)
- {
PostMessageW(client_thread.hwnd, WM_UIA_CLIENT_THREAD_STOP, 0, 0);
CoDecrementMTAUsage(client_thread.mta_cookie);
Is it OK to do this while client_thread may still be processing messages?