BACKENDS: Fix potential race condition in DefaultTimer
This commit is contained in:
parent
2b40cedad7
commit
a94e90d838
1 changed files with 4 additions and 0 deletions
|
@ -84,6 +84,10 @@ void DefaultTimerManager::handler() {
|
||||||
|
|
||||||
uint32 curTime = g_system->getMillis(true);
|
uint32 curTime = g_system->getMillis(true);
|
||||||
|
|
||||||
|
// On slow systems this could still be run after destructor
|
||||||
|
if (!_head)
|
||||||
|
return;
|
||||||
|
|
||||||
// Repeat as long as there is a TimerSlot that is scheduled to fire.
|
// Repeat as long as there is a TimerSlot that is scheduled to fire.
|
||||||
TimerSlot *slot = _head->next;
|
TimerSlot *slot = _head->next;
|
||||||
while (slot && slot->nextFireTime < curTime) {
|
while (slot && slot->nextFireTime < curTime) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue