From 2044b880153e049b5c7f691f7b6425a7f604843b Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 1 Feb 2012 03:31:19 +0100 Subject: [PATCH] Don't use NamedTimerFactory while it's being initialized. --- indra/llcommon/llfasttimer_class.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index 20f64d1a1..9b09b7926 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -130,8 +130,16 @@ public: mActiveTimerRoot->setCollapsed(false); mRootFrameState = new LLFastTimer::FrameState(mActiveTimerRoot); - mRootFrameState->mParent = &mTimerRoot->getFrameState(); - mActiveTimerRoot->setParent(mTimerRoot); + // getFrameState and setParent recursively call this function, + // so we have to work around that by using a specialized implementation + // for the special case were mTimerRoot != mActiveTimerRoot -- Aleric + mRootFrameState->mParent = &LLFastTimer::getFrameStateList()[0]; // &mTimerRoot->getFrameState() + // And the following four lines are mActiveTimerRoot->setParent(mTimerRoot); + llassert(!mActiveTimerRoot->mParent); + mActiveTimerRoot->mParent = mTimerRoot; // mParent = parent; + mRootFrameState->mParent = mRootFrameState->mParent; // getFrameState().mParent = &parent->getFrameState(); + mTimerRoot->getChildren().push_back(mActiveTimerRoot); // parent->getChildren().push_back(this); + mTimerRoot->mNeedsSorting = true; // parent->mNeedsSorting = true; mAppTimer = new LLFastTimer(mRootFrameState); }