diff options
author | Martin Kiewitz | 2010-10-19 14:53:39 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-10-19 14:53:39 +0000 |
commit | f8c72439383c6ea6324d03fa4c9e067a33af2235 (patch) | |
tree | c3b6bb054d96aa2cd479e0d50b70c3491c6b5928 /engines | |
parent | 6a1e874447e86d243a6cdd5bd95f0d95a1333059 (diff) | |
download | scummvm-rg350-f8c72439383c6ea6324d03fa4c9e067a33af2235.tar.gz scummvm-rg350-f8c72439383c6ea6324d03fa4c9e067a33af2235.tar.bz2 scummvm-rg350-f8c72439383c6ea6324d03fa4c9e067a33af2235.zip |
SCI: fixing possible deadlock inside clearPlaylist
thx to ajax16384
svn-id: r53613
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/sound/music.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index 0dfa02c83f..252ea5489c 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -158,8 +158,10 @@ void SciMusic::sendMidiCommandsFromQueue() { } void SciMusic::clearPlayList() { - Common::StackLock lock(_mutex); - + // we must NOT lock our mutex here. Playlist is modified inside soundKill() which will lock the mutex + // during deletion. If we lock it here, a deadlock may occur within soundStop() because that one + // calls the mixer, which will also lock the mixer mutex and if the mixer thread is active during + // that time, we will get a deadlock. while (!_playList.empty()) { soundStop(_playList[0]); soundKill(_playList[0]); |