* Fix a problem with CleanUp function trying to clean up music cache twice
parent
eb37da86ce
commit
88478990b9
|
@ -43,11 +43,16 @@ void ALSound::CleanUp()
|
||||||
if (mEnabled) {
|
if (mEnabled) {
|
||||||
GetLogger()->Info("Unloading files and closing device...\n");
|
GetLogger()->Info("Unloading files and closing device...\n");
|
||||||
StopAll();
|
StopAll();
|
||||||
|
StopMusic();
|
||||||
|
|
||||||
for (auto channel : mChannels) {
|
for (auto channel : mChannels) {
|
||||||
delete channel.second;
|
delete channel.second;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mCurrentMusic) {
|
||||||
|
delete mCurrentMusic;
|
||||||
|
}
|
||||||
|
|
||||||
for (auto item : mSounds) {
|
for (auto item : mSounds) {
|
||||||
delete item.second;
|
delete item.second;
|
||||||
}
|
}
|
||||||
|
@ -58,8 +63,6 @@ void ALSound::CleanUp()
|
||||||
|
|
||||||
mEnabled = false;
|
mEnabled = false;
|
||||||
|
|
||||||
mCurrentMusic->FreeBuffer();
|
|
||||||
delete mCurrentMusic;
|
|
||||||
alcDestroyContext(mContext);
|
alcDestroyContext(mContext);
|
||||||
alcCloseDevice(mDevice);
|
alcCloseDevice(mDevice);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue