Akihiro Sagawa : mciseq: Ensure the player thread termination when stopping.

Alexandre Julliard julliard at wine.codeweavers.com
Wed Jul 22 13:40:42 CDT 2015


Module: wine
Branch: master
Commit: 41c45f36866934f8da8a710aa12a2f374fca9275
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=41c45f36866934f8da8a710aa12a2f374fca9275

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Thu Jul 23 00:07:48 2015 +0900

mciseq: Ensure the player thread termination when stopping.

---

 dlls/mciseq/mcimidi.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/dlls/mciseq/mcimidi.c b/dlls/mciseq/mcimidi.c
index 62b3192..864ab98 100644
--- a/dlls/mciseq/mcimidi.c
+++ b/dlls/mciseq/mcimidi.c
@@ -776,7 +776,7 @@ static DWORD MIDI_mciStop(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_GENERIC_PARMS
 	if (oldstat == MCI_MODE_PAUSE)
 	    dwRet = midiOutReset((HMIDIOUT)wmm->hMidi);
 
-	if ((dwFlags & MCI_WAIT) && wmm->hThread)
+	if (wmm->hThread)
 	    WaitForSingleObject(wmm->hThread, INFINITE);
     }
 
@@ -808,7 +808,10 @@ static DWORD MIDI_mciClose(WINE_MCIMIDI* wmm, DWORD dwFlags, LPMCI_GENERIC_PARMS
 	    wmm->hFile = 0;
 	    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->lpstrElementName);
 	HeapFree(GetProcessHeap(), 0, wmm->lpstrCopyright);




More information about the wine-cvs mailing list