mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-04 22:47:39 +00:00
mciqtz32: Fix thread handle leak if a second play.
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
This commit is contained in:
parent
43f23d3e63
commit
de0794a1dd
|
@ -449,10 +449,13 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
|
|||
|
||||
IVideoWindow_put_Visible(wma->vidwin, OATRUE);
|
||||
|
||||
wma->thread = CreateThread(NULL, 0, MCIQTZ_notifyThread, wma, 0, NULL);
|
||||
if (!wma->thread) {
|
||||
TRACE("Can't create thread\n");
|
||||
return MCIERR_INTERNAL;
|
||||
if (!wma->thread)
|
||||
{
|
||||
wma->thread = CreateThread(NULL, 0, MCIQTZ_notifyThread, wma, 0, NULL);
|
||||
if (!wma->thread) {
|
||||
TRACE("Can't create thread\n");
|
||||
return MCIERR_INTERNAL;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1336,6 +1336,19 @@ static void test_playWaveTypeMpegvideo(void)
|
|||
|
||||
err = mciSendStringA("close mysound", NULL, 0, NULL);
|
||||
ok(!err,"mci close returned %s\n", dbg_mcierr(err));
|
||||
|
||||
/* test a second play */
|
||||
err = mciSendStringA("open tempfile.wav type MPEGVideo alias mysound", NULL, 0, NULL);
|
||||
ok(err==ok_saved,"mci open tempfile.wav type MPEGVideo returned %s\n", dbg_mcierr(err));
|
||||
|
||||
err = mciSendStringA("play mysound", NULL, 0, NULL);
|
||||
ok(!err,"mci play retuend %s\n", dbg_mcierr(err));
|
||||
|
||||
err = mciSendStringA("play mysound", NULL, 0, NULL);
|
||||
ok(!err,"mci play retuend %s\n", dbg_mcierr(err));
|
||||
|
||||
err = mciSendStringA("close mysound", NULL, 0, NULL);
|
||||
ok(!err,"mci close returned %s\n", dbg_mcierr(err));
|
||||
}
|
||||
|
||||
static void test_asyncWaveTypeMpegvideo(HWND hwnd)
|
||||
|
|
Loading…
Reference in a new issue