From 78f83dbce31c69add3a0586c426591ac163ba093 Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Wed, 1 Jan 2025 18:46:07 -0800 Subject: Fix sound system destruction. --- Spear/Sound/Sound.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Spear/Sound/Sound.hs b/Spear/Sound/Sound.hs index 832ffb8..887cf97 100644 --- a/Spear/Sound/Sound.hs +++ b/Spear/Sound/Sound.hs @@ -41,8 +41,10 @@ initSoundSystem = return newSoundState destroySoundSystem :: Game SoundState () destroySoundSystem = do state <- get - mapM_ release' (toList $ buffers state) + -- The order here matters; sources before buffers since buffers are attached + -- to sources. mapM_ release' (toList $ sources state) + mapM_ release' (toList $ buffers state) put newSoundState -- | Load an audio file. -- cgit v1.2.3