winealsa: Do not access WAVEHDR past DriverCallback.

This commit is contained in:
Jörg Höhle 2010-02-20 17:27:50 +01:00 committed by Alexandre Julliard
parent 4cff4c82a1
commit bdea146639
1 changed files with 3 additions and 3 deletions

View File

@ -292,15 +292,15 @@ static DWORD CALLBACK widRecorder(LPVOID pmt)
widRecorder_ReadHeaders(wwi);
/* return all buffers to the app */
for (lpWaveHdr = wwi->lpQueuePtr; lpWaveHdr; lpWaveHdr = lpWaveHdr->lpNext) {
while (wwi->lpQueuePtr) {
lpWaveHdr = wwi->lpQueuePtr;
TRACE("reset %p %p\n", lpWaveHdr, lpWaveHdr->lpNext);
wwi->lpQueuePtr = lpWaveHdr->lpNext;
lpWaveHdr->dwFlags &= ~WHDR_INQUEUE;
lpWaveHdr->dwFlags |= WHDR_DONE;
wwi->lpQueuePtr = lpWaveHdr->lpNext;
widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0);
}
wwi->lpQueuePtr = NULL;
SetEvent(ev);
break;
case WINE_WM_CLOSING: