From a46b0f21c397cd095319f8c9feccf0f1e50e31ba Mon Sep 17 00:00:00 2001 From: Peter Bech Date: Fri, 31 Jul 2020 09:02:07 +0200 Subject: [PATCH] Fixed memory leak (#222) * Fixed memory leak * Update src/wasapi.c Co-authored-by: TimTim * Update src/wasapi.c Co-authored-by: TimTim Co-authored-by: TimTim --- src/wasapi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/wasapi.c b/src/wasapi.c index 027c498..e3a8fb8 100644 --- a/src/wasapi.c +++ b/src/wasapi.c @@ -486,10 +486,16 @@ static void deinit_refresh_devices(struct RefreshDevices *rd) { soundio_device_unref(rd->device_raw); if (rd->mm_device) IMMDevice_Release(rd->mm_device); - if (rd->default_render_device) - IMMDevice_Release(rd->default_render_device); + if (rd->default_render_device) + { + IMMDevice_Release(rd->default_render_device); + free(rd->default_render_id); + } if (rd->default_capture_device) + { IMMDevice_Release(rd->default_capture_device); + free(rd->default_capture_id); + } if (rd->collection) IMMDeviceCollection_Release(rd->collection); if (rd->lpwstr)