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); widRecorder_ReadHeaders(wwi);
/* return all buffers to the app */ /* 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); TRACE("reset %p %p\n", lpWaveHdr, lpWaveHdr->lpNext);
wwi->lpQueuePtr = lpWaveHdr->lpNext;
lpWaveHdr->dwFlags &= ~WHDR_INQUEUE; lpWaveHdr->dwFlags &= ~WHDR_INQUEUE;
lpWaveHdr->dwFlags |= WHDR_DONE; lpWaveHdr->dwFlags |= WHDR_DONE;
wwi->lpQueuePtr = lpWaveHdr->lpNext;
widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0); widNotifyClient(wwi, WIM_DATA, (DWORD_PTR)lpWaveHdr, 0);
} }
wwi->lpQueuePtr = NULL;
SetEvent(ev); SetEvent(ev);
break; break;
case WINE_WM_CLOSING: case WINE_WM_CLOSING: