aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorAlyssa Milburn2013-05-29 09:04:44 +0200
committerAlyssa Milburn2013-05-29 09:05:20 +0200
commitb16f2d8405bab54a891325f0c6dec156f6006b1a (patch)
tree5b0604652be079333701ad1ff68d40e313d9b374 /engines
parentf055512f1758c4a5a5d73cd1a533e4c2329a190b (diff)
downloadscummvm-rg350-b16f2d8405bab54a891325f0c6dec156f6006b1a.tar.gz
scummvm-rg350-b16f2d8405bab54a891325f0c6dec156f6006b1a.tar.bz2
scummvm-rg350-b16f2d8405bab54a891325f0c6dec156f6006b1a.zip
SKY: Try to avoid deadlocks with the mixer mutex.
See bug #3512069.
Diffstat (limited to 'engines')
-rw-r--r--engines/sky/music/musicbase.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/engines/sky/music/musicbase.cpp b/engines/sky/music/musicbase.cpp
index b388afdb13..944edb1fdc 100644
--- a/engines/sky/music/musicbase.cpp
+++ b/engines/sky/music/musicbase.cpp
@@ -44,9 +44,9 @@ MusicBase::~MusicBase() {
}
void MusicBase::loadSection(uint8 pSection) {
- Common::StackLock lock(_mutex);
if (_currentMusic)
stopMusicInternal();
+ Common::StackLock lock(_mutex);
free(_musicData);
_currentSection = pSection;
_musicData = _skyDisk->loadFile(_driverFileBase + FILES_PER_SECTION * pSection);
@@ -70,13 +70,14 @@ bool MusicBase::musicIsPlaying() {
}
void MusicBase::stopMusic() {
- Common::StackLock lock(_mutex);
stopMusicInternal();
}
void MusicBase::stopMusicInternal() {
_mixer->stopHandle(_musicHandle);
+ Common::StackLock lock(_mutex);
+
for (uint8 cnt = 0; cnt < _numberOfChannels; cnt++)
delete _channels[cnt];
_numberOfChannels = 0;