Commit 41c45f36 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

mciseq: Ensure the player thread termination when stopping.

parent f94670b5
...@@ -776,7 +776,7 @@ static DWORD MIDI_mciStop(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_GENERIC_PARMS ...@@ -776,7 +776,7 @@ static DWORD MIDI_mciStop(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_GENERIC_PARMS
if (oldstat == MCI_MODE_PAUSE) if (oldstat == MCI_MODE_PAUSE)
dwRet = midiOutReset((HMIDIOUT)wmm->hMidi); dwRet = midiOutReset((HMIDIOUT)wmm->hMidi);
if ((dwFlags & MCI_WAIT) && wmm->hThread) if (wmm->hThread)
WaitForSingleObject(wmm->hThread, INFINITE); WaitForSingleObject(wmm->hThread, INFINITE);
} }
...@@ -808,7 +808,10 @@ static DWORD MIDI_mciClose(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_GENERIC_PARMS ...@@ -808,7 +808,10 @@ static DWORD MIDI_mciClose(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_GENERIC_PARMS
wmm->hFile = 0; wmm->hFile = 0;
TRACE("hFile closed !\n"); TRACE("hFile closed !\n");
} }
if (wmm->hThread) CloseHandle(wmm->hThread); if (wmm->hThread) {
CloseHandle(wmm->hThread);
wmm->hThread = 0;
}
HeapFree(GetProcessHeap(), 0, wmm->tracks); HeapFree(GetProcessHeap(), 0, wmm->tracks);
HeapFree(GetProcessHeap(), 0, wmm->lpstrElementName); HeapFree(GetProcessHeap(), 0, wmm->lpstrElementName);
HeapFree(GetProcessHeap(), 0, wmm->lpstrCopyright); HeapFree(GetProcessHeap(), 0, wmm->lpstrCopyright);
......
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