Fixed memory leak (#222)

* Fixed memory leak

* Update src/wasapi.c

Co-authored-by: TimTim <i@timtim.hk>

* Update src/wasapi.c

Co-authored-by: TimTim <i@timtim.hk>

Co-authored-by: TimTim <i@timtim.hk>
This commit is contained in:
Peter Bech 2020-07-31 09:02:07 +02:00 committed by GitHub
parent b810bf2e9c
commit a46b0f21c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -487,9 +487,15 @@ static void deinit_refresh_devices(struct RefreshDevices *rd) {
if (rd->mm_device)
IMMDevice_Release(rd->mm_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)