SAGA2: Fix timer delete on removeAllTimers
This commit is contained in:
parent
b0cf10eb67
commit
abad186530
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue