SCI: fixing possible deadlock inside clearPlaylist

thx to ajax16384

svn-id: r53613
This commit is contained in:
Martin Kiewitz 2010-10-19 14:53:39 +00:00
parent 6a1e874447
commit f8c7243938

View File

@ -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]);