diff options
Diffstat (limited to 'linden/indra/llcommon/lltimer.cpp')
-rw-r--r-- | linden/indra/llcommon/lltimer.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/linden/indra/llcommon/lltimer.cpp b/linden/indra/llcommon/lltimer.cpp index 6077063..177f1de 100644 --- a/linden/indra/llcommon/lltimer.cpp +++ b/linden/indra/llcommon/lltimer.cpp | |||
@@ -525,13 +525,27 @@ LLEventTimer::~LLEventTimer() | |||
525 | 525 | ||
526 | void LLEventTimer::updateClass() | 526 | void LLEventTimer::updateClass() |
527 | { | 527 | { |
528 | std::list<LLEventTimer*> completed_timers; | ||
528 | for (std::list<LLEventTimer*>::iterator iter = sActiveList.begin(); iter != sActiveList.end(); ) | 529 | for (std::list<LLEventTimer*>::iterator iter = sActiveList.begin(); iter != sActiveList.end(); ) |
529 | { | 530 | { |
530 | LLEventTimer* timer = *iter++; | 531 | LLEventTimer* timer = *iter++; |
531 | F32 et = timer->mEventTimer.getElapsedTimeF32(); | 532 | F32 et = timer->mEventTimer.getElapsedTimeF32(); |
532 | if (et > timer->mPeriod) { | 533 | if (et > timer->mPeriod) { |
533 | timer->mEventTimer.reset(); | 534 | timer->mEventTimer.reset(); |
534 | timer->tick(); | 535 | if ( timer->tick() ) |
536 | { | ||
537 | completed_timers.push_back( timer ); | ||
538 | } | ||
539 | } | ||
540 | } | ||
541 | |||
542 | if ( completed_timers.size() > 0 ) | ||
543 | { | ||
544 | for (std::list<LLEventTimer*>::iterator completed_iter = completed_timers.begin(); | ||
545 | completed_iter != completed_timers.end(); | ||
546 | completed_iter++ ) | ||
547 | { | ||
548 | delete *completed_iter; | ||
535 | } | 549 | } |
536 | } | 550 | } |
537 | } | 551 | } |