SAGA2: Fix timer delete on removeAllTimers

This commit is contained in:
a/ 2021-06-27 20:18:12 +09:00 committed by Eugene Sandulenko
parent b0cf10eb67
commit abad186530
No known key found for this signature in database
GPG Key ID: 014D387312D34F08

View File

@ -1844,9 +1844,10 @@ void GameObject::removeAllTimers(void) {
// Get this object's timer list
if ((timerList = fetchTimerList(this)) != nullptr) {
for (Common::List<Timer *>::iterator it = timerList->_timers.begin(); it != timerList->_timers.end(); ++it) {
timerList->_timers.erase(it);
}
for (Common::List<Timer *>::iterator it = timerList->_timers.begin(); it != timerList->_timers.end(); ++it)
delete *it;
timerList->_timers.clear();
delete timerList;
}