Module: wine Branch: master Commit: 5069c2ad9054f94ab143d62462ed924f8e98798e URL: https://gitlab.winehq.org/wine/wine/-/commit/5069c2ad9054f94ab143d62462ed924...
Author: Davide Beatrici git@davidebeatrici.dev Date: Mon Jun 26 23:13:31 2023 +0200
winecoreaudio: Refactor AudioClient's Release to match other drivers.
---
dlls/winecoreaudio.drv/mmdevdrv.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/winecoreaudio.drv/mmdevdrv.c b/dlls/winecoreaudio.drv/mmdevdrv.c index b8c320563e6..764f9e83752 100644 --- a/dlls/winecoreaudio.drv/mmdevdrv.c +++ b/dlls/winecoreaudio.drv/mmdevdrv.c @@ -402,17 +402,17 @@ static ULONG WINAPI AudioClient_Release(IAudioClient3 *iface) ref = InterlockedDecrement(&This->ref); TRACE("(%p) Refcount now %lu\n", This, ref); if(!ref){ - if(This->stream){ - stream_release(This->stream, This->timer_thread); - This->stream = 0; - + IAudioClient3_Stop(iface); + IMMDevice_Release(This->parent); + IUnknown_Release(This->marshal); + if(This->session){ sessions_lock(); list_remove(&This->entry); sessions_unlock(); } free(This->vols); - IMMDevice_Release(This->parent); - IUnknown_Release(This->marshal); + if(This->stream) + stream_release(This->stream, This->timer_thread); HeapFree(GetProcessHeap(), 0, This); } return ref;