| 377 | } |
| 378 | |
| 379 | void TimerSystem::KillTimer(ITimer *pTimer) |
| 380 | { |
| 381 | if (pTimer->m_KillMe) |
| 382 | { |
| 383 | return; |
| 384 | } |
| 385 | |
| 386 | if (pTimer->m_InExec) |
| 387 | { |
| 388 | pTimer->m_KillMe = true; |
| 389 | return; |
| 390 | } |
| 391 | |
| 392 | pTimer->m_InExec = true; /* The timer it's not really executed but this check needs to be done */ |
| 393 | pTimer->m_Listener->OnTimerEnd(pTimer, pTimer->m_pData); |
| 394 | |
| 395 | if (pTimer->m_Flags & TIMER_FLAG_REPEAT) |
| 396 | { |
| 397 | m_LoopTimers.remove(pTimer); |
| 398 | } else { |
| 399 | m_SingleTimers.remove(pTimer); |
| 400 | } |
| 401 | |
| 402 | m_FreeTimers.push(pTimer); |
| 403 | } |
| 404 | |
| 405 | CStack<ITimer *> s_tokill; |
| 406 | void TimerSystem::RemoveMapChangeTimers() |
no test coverage detected