diff options
author | erihel <erihel@gmail.com> | 2013-04-26 14:15:11 +0200 |
---|---|---|
committer | erihel <erihel@gmail.com> | 2013-04-26 14:15:11 +0200 |
commit | 88478990b97c9c8d86a5a5edb8e293863266b640 (patch) | |
tree | f30077adef4d97e301d2ea5e552f9fda9a9be95a | |
parent | eb37da86cee79e024998ab39d52183ce4528466b (diff) | |
download | colobot-88478990b97c9c8d86a5a5edb8e293863266b640.tar.gz colobot-88478990b97c9c8d86a5a5edb8e293863266b640.tar.bz2 colobot-88478990b97c9c8d86a5a5edb8e293863266b640.zip |
* Fix a problem with CleanUp function trying to clean up music cache twice
-rw-r--r-- | src/sound/oalsound/alsound.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp index 50564e9..cfb0c70 100644 --- a/src/sound/oalsound/alsound.cpp +++ b/src/sound/oalsound/alsound.cpp @@ -43,11 +43,16 @@ void ALSound::CleanUp() if (mEnabled) { GetLogger()->Info("Unloading files and closing device...\n"); StopAll(); + StopMusic(); for (auto channel : mChannels) { delete channel.second; } + if (mCurrentMusic) { + delete mCurrentMusic; + } + for (auto item : mSounds) { delete item.second; } @@ -58,8 +63,6 @@ void ALSound::CleanUp() mEnabled = false; - mCurrentMusic->FreeBuffer(); - delete mCurrentMusic; alcDestroyContext(mContext); alcCloseDevice(mDevice); } |