faudio: Purge and clear notifications on ShutDown.

Cherry-picked from upstream commit 16f86bffec36b6e82e5c93d5f04ebc4ee4f980ab.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54264
This commit is contained in:
Alistair Leslie-Hughes 2023-01-09 07:06:11 +11:00 committed by Alexandre Julliard
parent 448e68ab5b
commit 8e9763871b
Notes: Alexandre Julliard 2023-01-09 22:04:11 +01:00
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/-/merge_requests/1923

View file

@ -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.
*/