win midi: more initialization checks

This commit is contained in:
Roman Fomin 2023-06-19 13:34:04 +07:00
parent af60bcad49
commit 40f508d2aa

View File

@ -1478,7 +1478,7 @@ static void I_WIN_StopSong(void *handle)
{
MMRESULT mmr;
if (!hMidiStream)
if (!hPlayerThread)
{
return;
}
@ -1488,6 +1488,11 @@ static void I_WIN_StopSong(void *handle)
CloseHandle(hPlayerThread);
hPlayerThread = NULL;
if (!hMidiStream)
{
return;
}
mmr = midiStreamStop(hMidiStream);
if (mmr != MMSYSERR_NOERROR)
{