From f6ed8bfea62cbcbab8726f479b158513f8692c28 Mon Sep 17 00:00:00 2001
From: Richard Nelson <richard@lindenlab.com>
Date: Wed, 20 Jul 2011 18:46:34 -0700
Subject: fix for crash when adding new fast timers

---
 indra/llcommon/llfasttimer_class.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp
index bd594b06cf..1dfc194d7c 100644
--- a/indra/llcommon/llfasttimer_class.cpp
+++ b/indra/llcommon/llfasttimer_class.cpp
@@ -228,6 +228,13 @@ void LLFastTimer::DeclareTimer::updateCachedPointers()
 		// update cached pointer
 		it->mFrameState = &it->mTimer.getFrameState();
 	}
+	// also update frame states of timers on stack
+	LLFastTimer* cur_timerp = LLFastTimer::sCurTimerData.mCurTimer;
+	while(cur_timerp->mLastTimerData.mCurTimer != cur_timerp)	
+	{
+		cur_timerp->mFrameState = &cur_timerp->mFrameState->mTimer->getFrameState();
+		cur_timerp = cur_timerp->mLastTimerData.mCurTimer;
+	}
 }
 
 //static
-- 
cgit v1.2.3