diff --git a/src/FNAPlatform/SDL2_FNAPlatform.cs b/src/FNAPlatform/SDL2_FNAPlatform.cs index 623610b2..df1da8f8 100644 --- a/src/FNAPlatform/SDL2_FNAPlatform.cs +++ b/src/FNAPlatform/SDL2_FNAPlatform.cs @@ -379,6 +379,8 @@ public static void ProgramExit(object sender, EventArgs e) if (SoundEffect.FAudioContext.Context != null) { + GC.Collect(); // Desperate last bid to collect SoundEffectInstances + SoundEffect.FAudioContext.Context.Dispose(); } Media.MediaPlayer.DisposeIfNecessary(); diff --git a/src/FNAPlatform/SDL3_FNAPlatform.cs b/src/FNAPlatform/SDL3_FNAPlatform.cs index 1e764bdb..657ad676 100644 --- a/src/FNAPlatform/SDL3_FNAPlatform.cs +++ b/src/FNAPlatform/SDL3_FNAPlatform.cs @@ -284,6 +284,8 @@ public static void ProgramExit(object sender, EventArgs e) if (SoundEffect.FAudioContext.Context != null) { + GC.Collect(); // Desperate last bid to collect SoundEffectInstances + SoundEffect.FAudioContext.Context.Dispose(); } Media.MediaPlayer.DisposeIfNecessary();