Jinoh Kang (@iamahuman) commented about dlls/windows.media.speech/recognizer.c:
impl->worker_running = TRUE;
if (!(impl->worker_thread = CreateThread(NULL, 0, session_worker_thread_cb, impl, 0, NULL)))
{
hr = HRESULT_FROM_WIN32(GetLastError());
impl->worker_running = FALSE;
}
impl->recognizer_state = SpeechRecognizerState_Capturing;
- }
- else
invalid_state = TRUE;
- LeaveCriticalSection(&impl->cs);
- if (invalid_state && SUCCEEDED(hr))
hr = COR_E_INVALIDOPERATION;
- return hr;
You should release `*action` and set it to `NULL` on failure.