aboutsummaryrefslogtreecommitdiff
path: root/backends/timer
diff options
context:
space:
mode:
authorAlyssa Milburn2011-08-17 09:28:51 +0200
committerAlyssa Milburn2011-08-17 09:28:51 +0200
commitae287ccee58ebf68ab6125e5bbb4d8a44874330e (patch)
tree2f4cee4b2940466b8a578962e0174c6f89077a40 /backends/timer
parentf5255288eabc0527c4c6b727a9db6b8d09a31206 (diff)
parente36832bbf84cba88fe6b17e1634fab0d550f13df (diff)
downloadscummvm-rg350-ae287ccee58ebf68ab6125e5bbb4d8a44874330e.tar.gz
scummvm-rg350-ae287ccee58ebf68ab6125e5bbb4d8a44874330e.tar.bz2
scummvm-rg350-ae287ccee58ebf68ab6125e5bbb4d8a44874330e.zip
Merge remote-tracking branch 'origin/master' into soccer
Conflicts: engines/scumm/he/logic_he.cpp engines/scumm/he/logic_he.h
Diffstat (limited to 'backends/timer')
-rw-r--r--backends/timer/default/default-timer.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp
index efb3ec9ad9..e1aadb62b8 100644
--- a/backends/timer/default/default-timer.cpp
+++ b/backends/timer/default/default-timer.cpp
@@ -161,4 +161,21 @@ void DefaultTimerManager::removeTimerProc(TimerProc callback) {
slot = slot->next;
}
}
+
+ // We need to remove all names referencing the timer proc here.
+ //
+ // Else we run into troubles, when the client code removes and readds timer
+ // callbacks.
+ //
+ // Another issues occurs when one plays a game with ALSA as music driver,
+ // does RTL and starts a different engine game with ALSA as music driver.
+ // In this case the MPU401 code will add different timer procs with the
+ // same name, resulting in two different callbacks added with the same
+ // name and causing installTimerProc to error out.
+ // A good test case is running a SCUMM with ALSA output and then a KYRA
+ // game for example.
+ for (TimerSlotMap::iterator i = _callbacks.begin(), end = _callbacks.end(); i != end; ++i) {
+ if (i->_value == callback)
+ _callbacks.erase(i);
+ }
}