diff options
author | Johannes Schickel | 2011-08-10 18:15:00 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-08-10 18:22:25 +0200 |
commit | cea06991ebab97c72e9fd89a4bf63835bcf0de80 (patch) | |
tree | d8b8d5f46e581f8c7cd8e11e676aeef12eca3156 /backends/timer | |
parent | f049e6788ae029e5e0750408e3571037acfb2abd (diff) | |
download | scummvm-rg350-cea06991ebab97c72e9fd89a4bf63835bcf0de80.tar.gz scummvm-rg350-cea06991ebab97c72e9fd89a4bf63835bcf0de80.tar.bz2 scummvm-rg350-cea06991ebab97c72e9fd89a4bf63835bcf0de80.zip |
TIMER: Remove name of callback in removeTimerProc.
This should fix #3389673 "LOOM: CD-Version crashes at start". It also fixes the
same error showing up for me in Monkey CD.
The doc changes in 4c7958450f628937270f claims the name is used for the event
recorder, but as far as I can tell it is not used right now. Thus depending on
how it is used the behavior of SCUMM removing and adding the same timer aagain
*might* cause problems.
In any way we need to remove the name in removeTimerProc, else RTL + launching
the same game again would be broken too.
Diffstat (limited to 'backends/timer')
-rw-r--r-- | backends/timer/default/default-timer.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/timer/default/default-timer.cpp b/backends/timer/default/default-timer.cpp index efb3ec9ad9..28524bf3b5 100644 --- a/backends/timer/default/default-timer.cpp +++ b/backends/timer/default/default-timer.cpp @@ -161,4 +161,11 @@ void DefaultTimerManager::removeTimerProc(TimerProc callback) { slot = slot->next; } } + + for (TimerSlotMap::iterator i = _callbacks.begin(), end = _callbacks.end(); i != end; ++i) { + if (i->_value == callback) { + _callbacks.erase(i); + break; + } + } } |