diff options
author | simon <none@none> | 2013-04-17 11:17:46 -0700 |
---|---|---|
committer | simon <none@none> | 2013-04-17 11:17:46 -0700 |
commit | 6742d90d39fbb5c5bc3b675f37841fd6c8ec09c9 (patch) | |
tree | 841285193b28a3c971051f53573a2a2f1c83a330 /indra | |
parent | c537b63936e49d4e685d96695334fdd7a961b470 (diff) |
Some minor cleanups while hunting crashes. Reviewed by Kelly
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llcommon.cpp | 1 | ||||
-rw-r--r-- | indra/llcommon/llinstancetracker.h | 8 | ||||
-rw-r--r-- | indra/llcommon/llthread.cpp | 3 | ||||
-rw-r--r-- | indra/llcommon/llthread.h | 2 | ||||
-rw-r--r-- | indra/newview/llflexibleobject.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llviewerobject.h | 18 |
6 files changed, 26 insertions, 11 deletions
diff --git a/indra/llcommon/llcommon.cpp b/indra/llcommon/llcommon.cpp index 8be9e4f4de..b938b0e65a 100644 --- a/indra/llcommon/llcommon.cpp +++ b/indra/llcommon/llcommon.cpp @@ -44,6 +44,7 @@ void LLCommon::initClass() } LLTimer::initClass(); LLThreadSafeRefCount::initThreadSafeRefCount(); + assert_main_thread(); // Make sure we record the main thread // LLWorkerThread::initClass(); // LLFrameCallbackManager::initClass(); } diff --git a/indra/llcommon/llinstancetracker.h b/indra/llcommon/llinstancetracker.h index 0f952f56ac..b290526754 100644 --- a/indra/llcommon/llinstancetracker.h +++ b/indra/llcommon/llinstancetracker.h @@ -102,6 +102,8 @@ protected: }; }; +LL_COMMON_API void assert_main_thread(); + /// This mix-in class adds support for tracking all instances of the specified class parameter T /// The (optional) key associates a value of type KEY with a given instance of T, for quick lookup /// If KEY is not provided, then instances are stored in a simple set @@ -116,7 +118,11 @@ class LLInstanceTracker : public LLInstanceTrackerBase InstanceMap sMap; }; static StaticData& getStatic() { return LLInstanceTrackerBase::getStatic<StaticData, MyT, T, TRACKED>(); } - static InstanceMap& getMap_() { return getStatic().sMap; } + static InstanceMap& getMap_() + { + // assert_main_thread(); fwiw this class is not thread safe, and it used by multiple threads. Bad things happen. + return getStatic().sMap; + } public: class instance_iter : public boost::iterator_facade<instance_iter, T, boost::forward_traversal_tag> diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 6c117f7daf..60adeeaeb7 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -67,7 +67,8 @@ LL_COMMON_API void assert_main_thread() static U32 s_thread_id = LLThread::currentID(); if (LLThread::currentID() != s_thread_id) { - llerrs << "Illegal execution outside main thread." << llendl; + llwarns << "Illegal execution from thread id " << (S32) LLThread::currentID() + << " outside main thread " << (S32) s_thread_id << llendl; } } diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 8c95b1c0e5..11594f276e 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -311,4 +311,6 @@ public: //============================================================================ +extern LL_COMMON_API void assert_main_thread(); + #endif // LL_LLTHREAD_H diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index bf479dc92e..98c0c0bf51 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -294,6 +294,9 @@ void LLVolumeImplFlexible::onSetVolume(const LLVolumeParams &volume_params, cons void LLVolumeImplFlexible::updateRenderRes() { + if (!mAttributes) + return; + LLDrawable* drawablep = mVO->mDrawable; S32 new_res = mAttributes->getSimulateLOD(); @@ -435,7 +438,7 @@ void LLVolumeImplFlexible::doFlexibleUpdate() } } - if(!mInitialized) + if(!mInitialized || !mAttributes) { //the object is not visible return ; diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 1b4291a1d1..40e09a4f41 100644 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -112,14 +112,6 @@ class LLViewerObject : public LLPrimitive, public LLRefCount, public LLGLUpdate protected: ~LLViewerObject(); // use unref() - // TomY: Provide for a list of extra parameter structures, mapped by structure name - struct ExtraParameter - { - BOOL in_use; - LLNetworkData *data; - }; - std::map<U16, ExtraParameter*> mExtraParameterList; - public: typedef std::list<LLPointer<LLViewerObject> > child_list_t; typedef std::list<LLPointer<LLViewerObject> > vobj_list_t; @@ -545,6 +537,8 @@ public: std::vector<LLVector3> mUnselectedChildrenPositions ; private: + // TomY: Provide for a list of extra parameter structures, mapped by structure name + struct ExtraParameter; ExtraParameter* createNewParameterEntry(U16 param_type); ExtraParameter* getExtraParameterEntry(U16 param_type) const; ExtraParameter* getExtraParameterEntryCreate(U16 param_type); @@ -782,6 +776,14 @@ private: LLUUID mAttachmentItemID; // ItemID of the associated object is in user inventory. EObjectUpdateType mLastUpdateType; BOOL mLastUpdateCached; + + // TomY: Provide for a list of extra parameter structures, mapped by structure name + struct ExtraParameter + { + BOOL in_use; + LLNetworkData *data; + }; + std::map<U16, ExtraParameter*> mExtraParameterList; }; /////////////////// |