From 59565c03ad8bb82ddbfc402774fe6a95c92bb7ba Mon Sep 17 00:00:00 2001 From: David Reid Date: Tue, 8 Jun 2021 21:21:20 +1000 Subject: [PATCH] Fix a subtle memory leak. --- research/miniaudio_engine.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/research/miniaudio_engine.h b/research/miniaudio_engine.h index 14f6118f..ee090dea 100644 --- a/research/miniaudio_engine.h +++ b/research/miniaudio_engine.h @@ -7040,7 +7040,7 @@ early_exit: } else { /* Loading asynchronously. We may need to wait for initialization. */ if ((flags & MA_DATA_SOURCE_FLAG_WAIT_INIT) != 0) { - ma_resource_manager_inline_notification_wait_and_uninit(&initNotification); + ma_resource_manager_inline_notification_wait(&initNotification); } } } @@ -7054,6 +7054,10 @@ done: } } + if ((flags & MA_DATA_SOURCE_FLAG_WAIT_INIT) != 0) { + ma_resource_manager_inline_notification_uninit(&initNotification); + } + *ppDataBufferNode = pDataBufferNode; return result;