Commit 81bc7a90 authored by David Reid's avatar David Reid

Fix a memory leak with devices.

parent 61b95779
...@@ -36990,6 +36990,13 @@ MA_API void ma_device_uninit(ma_device* pDevice) ...@@ -36990,6 +36990,13 @@ MA_API void ma_device_uninit(ma_device* pDevice)
} }
} }
if (pDevice->type == ma_device_type_capture || pDevice->type == ma_device_type_duplex || pDevice->type == ma_device_type_loopback) {
ma_data_converter_uninit(&pDevice->capture.converter, &pDevice->pContext->allocationCallbacks);
}
if (pDevice->type == ma_device_type_playback || pDevice->type == ma_device_type_duplex) {
ma_data_converter_uninit(&pDevice->playback.converter, &pDevice->pContext->allocationCallbacks);
}
if (pDevice->playback.pInputCache != NULL) { if (pDevice->playback.pInputCache != NULL) {
ma_free(pDevice->playback.pInputCache, &pDevice->pContext->allocationCallbacks); ma_free(pDevice->playback.pInputCache, &pDevice->pContext->allocationCallbacks);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment