diff options
| author | 3gg <3gg@shellblade.net> | 2025-01-01 18:46:07 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-01-01 18:46:07 -0800 |
| commit | 78f83dbce31c69add3a0586c426591ac163ba093 (patch) | |
| tree | baa70fb4eb8010bb0e72cb91dcfbd2eb0a86adb1 | |
| parent | acc954c9ac3a18e2d48e52839a7dc751597dfb15 (diff) | |
Fix sound system destruction.
| -rw-r--r-- | Spear/Sound/Sound.hs | 4 |
1 files changed, 3 insertions, 1 deletions
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 | |||
| 41 | destroySoundSystem :: Game SoundState () | 41 | destroySoundSystem :: Game SoundState () |
| 42 | destroySoundSystem = do | 42 | destroySoundSystem = do |
| 43 | state <- get | 43 | state <- get |
| 44 | mapM_ release' (toList $ buffers state) | 44 | -- The order here matters; sources before buffers since buffers are attached |
| 45 | -- to sources. | ||
| 45 | mapM_ release' (toList $ sources state) | 46 | mapM_ release' (toList $ sources state) |
| 47 | mapM_ release' (toList $ buffers state) | ||
| 46 | put newSoundState | 48 | put newSoundState |
| 47 | 49 | ||
| 48 | -- | Load an audio file. | 50 | -- | Load an audio file. |
