From da4d62e205afceb06c46c2d3cfe465a147d18955 Mon Sep 17 00:00:00 2001
From: Laine Walker-Avina <lwalkera@ieee.org>
Date: Tue, 3 Nov 2009 01:49:12 -0800
Subject: [PATCH 1/2] SCI sfx: fix iterators from not getting freed when there's only one song left playing
---
engines/sci/sfx/core.cpp | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index acc89f6..fd28193 100644
a
|
b
|
void SfxState::updateMultiSong() {
|
566 | 566 | |
567 | 567 | // WORKAROUND: sometimes, newsong can be NULL (e.g. in SQ4). |
568 | 568 | // Handle this here, so that we avoid a crash |
569 | | if (!newsong) |
| 569 | if (!newsong) { |
| 570 | if(oldfirst && oldfirst->_status == SOUND_STATUS_STOPPED) { |
| 571 | debugC(2, kDebugLevelSound, "[SFX] Stopping song %lx\n", oldfirst->_handle); |
| 572 | if (_player && oldfirst->_it) |
| 573 | _player->iterator_message(SongIterator::Message(oldfirst->_it->ID, SIMSG_STOP)); |
| 574 | } |
570 | 575 | return; |
| 576 | } |
571 | 577 | |
572 | 578 | for (newseeker = newsong; newseeker; |
573 | 579 | newseeker = newseeker->_nextPlaying) { |