diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-11-12 18:11:25 -0500 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-11-12 18:11:25 -0500 |
commit | b685895dd09c4520027bbdcb48c749e5ea2e0485 (patch) | |
tree | 5f82cbf7f826e51b7705a699df490e12198a406c | |
parent | 4acc05b3793623a03ea763c5c8c4072f986ee286 (diff) |
EXT-2426 : Remove COF processing that is causing recursive calls to gInventory.notifyObservers
Changing COF processing to happen during idle(), versus within done().
Reviewed by: Vir
--HG--
branch : avatar-pipeline
-rw-r--r-- | indra/newview/llagentwearables.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 9b4986247f..5bf1573a2c 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -35,6 +35,7 @@ #include "llagent.h" #include "llagentwearables.h" +#include "llcallbacklist.h" #include "llfloatercustomize.h" #include "llfloaterinventory.h" #include "llinventorybridge.h" @@ -82,6 +83,8 @@ public: protected: void processWearablesMessage(); + void processContents(); + static void onIdle(void *userdata); }; LLAgentWearables gAgentWearables; @@ -2002,11 +2005,34 @@ void LLAgentWearables::updateServer() gAgent.sendAgentSetAppearance(); } +//-------------------------------------------------------------------- +// InitialWearablesFetch +// +// This grabs contents from the COF and processes them. +// The processing is handled in idle(), i.e. outside of done(), +// to avoid gInventory.notifyObservers recursion. +//-------------------------------------------------------------------- + +// virtual void LLInitialWearablesFetch::done() { - // No longer need this observer hanging around. + // Delay processing the actual results of this so it's not handled within + // gInventory.notifyObservers. The results will be handled in the next + // idle tick instead. gInventory.removeObserver(this); + gIdleCallbacks.addFunction(onIdle, this); +} +// static +void LLInitialWearablesFetch::onIdle(void *data) +{ + gIdleCallbacks.deleteFunction(onIdle, data); + LLInitialWearablesFetch *self = reinterpret_cast<LLInitialWearablesFetch*>(data); + self->processContents(); +} + +void LLInitialWearablesFetch::processContents() +{ // Fetch the wearable items from the Current Outfit Folder LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; |