xaudio2: Don't keep running after master voice is destroyed.

This commit is contained in:
Andrew Eikum 2015-09-11 10:55:50 -05:00 committed by Alexandre Julliard
parent f326e372d1
commit 4c8ed8d104
1 changed files with 7 additions and 3 deletions

View File

@ -1188,6 +1188,8 @@ static void WINAPI XA2M_DestroyVoice(IXAudio2MasteringVoice *iface)
return;
}
This->running = FALSE;
IAudioRenderClient_Release(This->render);
This->render = NULL;
@ -3068,11 +3070,13 @@ static DWORD WINAPI engine_threadproc(void *arg)
if(This->stop_engine)
break;
if(!This->running)
continue;
EnterCriticalSection(&This->lock);
if(!This->running || !This->aclient){
LeaveCriticalSection(&This->lock);
continue;
}
do_engine_tick(This);
LeaveCriticalSection(&This->lock);