[Audio] Make sure freeing g_SoundDriver on closing

This commit is contained in:
zilmar 2018-11-26 08:02:41 +10:30
parent bb29e78806
commit 529b162656
1 changed files with 6 additions and 0 deletions

View File

@ -165,6 +165,12 @@ EXPORT void CALL AiUpdate(int32_t Wait)
EXPORT void CALL CloseDLL(void)
{
WriteTrace(TraceAudioInterface, TraceDebug, "Called");
if (g_SoundDriver != NULL)
{
g_SoundDriver->AI_Shutdown();
delete g_SoundDriver;
g_SoundDriver = NULL;
}
CleanupAudioSettings();
StopTrace();
}