From fea3b4f151a78b7e05c3b042e0f9295c2f243d3b Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 8 Jul 2011 21:32:30 +0300 Subject: Fix music fade out. --- src/sound.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/sound.cpp b/src/sound.cpp index a9157af1b..92a5eaa6f 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -67,6 +67,9 @@ Sound::~Sound() config.removeListener("playBattleSound", this); config.removeListener("playGuiSound", this); config.removeListener("playMusic", this); + + // Unlink the callback function. + Mix_HookMusicFinished(NULL); } void Sound::optionChanged(const std::string &value) @@ -77,8 +80,6 @@ void Sound::optionChanged(const std::string &value) mPlayGui = config.getBoolValue("playGuiSound"); else if (value == "playMusic") mPlayMusic = config.getBoolValue("playMusic"); - // Unlink the callback function. - Mix_HookMusicFinished(NULL); } void Sound::init() -- cgit v1.2.3-70-g09d2