From 14d942f16b284ca5180b29f3c912d158c0d0cdd0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 4 Feb 2010 11:08:49 +0000 Subject: A flag+assert to help track bad behaviour in LLEventTimer, especially EXT-4754 --- indra/llcommon/lltimer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llcommon/lltimer.cpp') diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index ef3e8dbc94..63634117b5 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -565,19 +565,23 @@ LLEventTimer::LLEventTimer(F32 period) : mEventTimer() { mPeriod = period; + mBusy = false; } LLEventTimer::LLEventTimer(const LLDate& time) : mEventTimer() { mPeriod = (F32)(time.secondsSinceEpoch() - LLDate::now().secondsSinceEpoch()); + mBusy = false; } LLEventTimer::~LLEventTimer() { + llassert(!mBusy); // this LLEventTimer was destroyed from its own tick() function - bad. } +//static void LLEventTimer::updateClass() { std::list completed_timers; @@ -587,10 +591,12 @@ void LLEventTimer::updateClass() F32 et = timer.mEventTimer.getElapsedTimeF32(); if (timer.mEventTimer.getStarted() && et > timer.mPeriod) { timer.mEventTimer.reset(); + timer.mBusy = true; if ( timer.tick() ) { completed_timers.push_back( &timer ); } + timer.mBusy = false; } } -- cgit v1.2.3 From 2c30ccf34d518ccedd0b3ffdeb2ba1da8d140a1d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 4 Feb 2010 11:24:14 +0000 Subject: EXT-4754 Crash in LLEventTimer::updateClass --- indra/llcommon/lltimer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llcommon/lltimer.cpp') diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 63634117b5..21e165ebc9 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -578,7 +578,7 @@ LLEventTimer::LLEventTimer(const LLDate& time) LLEventTimer::~LLEventTimer() { - llassert(!mBusy); // this LLEventTimer was destroyed from its own tick() function - bad. + llassert(!mBusy); // this LLEventTimer was destroyed from within its own tick() function - bad. if you want tick() to cause destruction of its own timer, make it return true. } //static -- cgit v1.2.3