SAGA2: Fix list removal on cleanupTimers

This commit is contained in:
a/ 2021-07-12 17:07:11 +09:00
parent 5e6d32062c
commit 97f90e5e2d

View File

@ -408,18 +408,13 @@ void loadTimers(Common::InSaveFile *in) {
// Cleanup the active Timers
void cleanupTimers(void) {
Common::List<TimerList *>::iterator timerListNextIt;
for (Common::List<TimerList *>::iterator it = g_vm->_timerLists.begin(); it != g_vm->_timerLists.end(); it = timerListNextIt) {
timerListNextIt = it;
timerListNextIt++;
delete *it;
}
while (g_vm->_timerLists.size() > 0)
delete g_vm->_timerLists.front();
Common::List<Timer *>::iterator timerNextIt;
for (Common::List<Timer *>::iterator it = g_vm->_timers.begin(); it != g_vm->_timers.end(); it = timerNextIt) {
timerNextIt = it;
timerNextIt++;
delete *it;
while (g_vm->_timers.size() > 0) {
Timer *t = g_vm->_timers.front();
deleteTimer(t);
delete t;
}
}