From 8e9763871b6f33e298c4c24627c490b1b46dda7e Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Mon, 9 Jan 2023 07:06:11 +1100 Subject: [PATCH] faudio: Purge and clear notifications on ShutDown. Cherry-picked from upstream commit 16f86bffec36b6e82e5c93d5f04ebc4ee4f980ab. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54264 --- libs/faudio/src/FACT.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/faudio/src/FACT.c b/libs/faudio/src/FACT.c index 649abf2111c..d40e56f12e6 100644 --- a/libs/faudio/src/FACT.c +++ b/libs/faudio/src/FACT.c @@ -352,6 +352,16 @@ uint32_t FACTAudioEngine_ShutDown(FACTAudioEngine *pEngine) FAudio_StopEngine(pEngine->audio); } + /* Purge All pending notifactions */ + while (pEngine->wb_notifications_list) + { + FACTNotification *note = (FACTNotification*) pEngine->wb_notifications_list->entry; + pEngine->notificationCallback(note); + LinkedList_RemoveEntry(&pEngine->wb_notifications_list, note, pEngine->apiLock, pEngine->pFree); + } + + pEngine->notifications = 0; + /* This method destroys all existing cues, sound banks, and wave banks. * It blocks until all cues are destroyed. */ -- 2.11.4.GIT