Module: wine Branch: master Commit: 33685372dda6e17ece18d538b649b6022ca1af36 URL: https://gitlab.winehq.org/wine/wine/-/commit/33685372dda6e17ece18d538b649b60...
Author: Davide Beatrici git@davidebeatrici.dev Date: Mon Jun 26 23:14:00 2023 +0200
winepulse: Refactor AudioClient's Release to match other drivers.
---
dlls/winepulse.drv/mmdevdrv.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/dlls/winepulse.drv/mmdevdrv.c b/dlls/winepulse.drv/mmdevdrv.c index 4631c5ab60e..9e233cb845e 100644 --- a/dlls/winepulse.drv/mmdevdrv.c +++ b/dlls/winepulse.drv/mmdevdrv.c @@ -423,15 +423,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(); } - IUnknown_Release(This->marshal); - IMMDevice_Release(This->parent); + free(This->vols); + if (This->stream) + stream_release(This->stream, This->timer_thread); HeapFree(GetProcessHeap(), 0, This); } return ref;