Commit 04e3bda4 authored by Jörg Höhle's avatar Jörg Höhle Committed by Alexandre Julliard

winealsa: Open must fail when recorder thread creation fails.

parent 56f2c580
......@@ -511,7 +511,12 @@ static DWORD widOpen(WORD wDevID, LPWAVEOPENDESC lpDesc, DWORD dwFlags)
wwi->hStartUpEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
wwi->hThread = CreateThread(NULL, 0, widRecorder, (LPVOID)(DWORD_PTR)wDevID, 0, &(wwi->dwThreadID));
if (wwi->hThread)
if (!wwi->hThread) {
ERR("Thread creation for the widRecorder failed!\n");
CloseHandle(wwi->hStartUpEvent);
ret = MMSYSERR_NOMEM;
goto error;
}
SetThreadPriority(wwi->hThread, THREAD_PRIORITY_TIME_CRITICAL);
WaitForSingleObject(wwi->hStartUpEvent, INFINITE);
CloseHandle(wwi->hStartUpEvent);
......@@ -525,6 +530,8 @@ error:
snd_pcm_close(pcm);
HeapFree( GetProcessHeap(), 0, hw_params );
HeapFree( GetProcessHeap(), 0, sw_params );
if (wwi->msgRing.ring_buffer_size > 0)
ALSA_DestroyRingMessage(&wwi->msgRing);
return ret;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment