mciqtz32: Fix thread handle leak if a second play.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
This commit is contained in:
Akihiro Sagawa 2022-07-05 21:02:49 +09:00 committed by Alexandre Julliard
parent 43f23d3e63
commit de0794a1dd
2 changed files with 20 additions and 4 deletions

View file

@ -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;
}

View file

@ -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)