diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2013-05-16 16:58:04 -0600 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2013-05-16 16:58:04 -0600 |
commit | 7006cbe3a24a88da4182f5930bb0fe712c43ce8c (patch) | |
tree | 4219eca4bfda08adfcbacdefcf4527eaf11f9c63 | |
parent | bbefabff3e2f3453ac682262defe0e7f9b94d5a8 (diff) |
fix for SH-4080: interesting: random crash on Mac
-rw-r--r-- | indra/newview/llvieweroctree.cpp | 6 | ||||
-rw-r--r-- | indra/newview/llviewerregion.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llviewerregion.h | 3 |
3 files changed, 6 insertions, 34 deletions
diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 0670b47f52..62108f0512 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -327,11 +327,7 @@ void LLViewerOctreeEntryData::setVisible() const LLviewerOctreeGroup::~LLviewerOctreeGroup() { - if(LLViewerRegion::sCurRegionp && isVisible()) - { - LLViewerRegion::sCurRegionp->clearVisibleGroup(this); - } - llassert(!LLViewerRegion::sCurRegionp || LLViewerRegion::sCurRegionp->hasVisibleGroup(this) == false); + //empty here } LLviewerOctreeGroup::LLviewerOctreeGroup(OctreeNode* node) : diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 2ba0d939be..85da75510b 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -86,7 +86,6 @@ const F32 CAP_REQUEST_TIMEOUT = 18; // Even though we gave up on login, keep trying for caps after we are logged in: const S32 MAX_CAP_REQUEST_ATTEMPTS = 30; -LLViewerRegion* LLViewerRegion::sCurRegionp = NULL; BOOL LLViewerRegion::sVOCacheCullingEnabled = FALSE; typedef std::map<std::string, std::string> CapabilityMap; @@ -143,7 +142,7 @@ public: LLVOCacheEntry::vocache_entry_map_t mCacheMap; //all cached entries LLVOCacheEntry::vocache_entry_set_t mActiveSet; //all active entries; LLVOCacheEntry::vocache_entry_set_t mWaitingSet; //entries waiting for LLDrawable to be generated. - std::set< LLviewerOctreeGroup* > mVisibleGroups; //visible groupa + std::set< LLPointer<LLviewerOctreeGroup> > mVisibleGroups; //visible groupa LLVOCachePartition* mVOCachePartition; LLVOCacheEntry::vocache_entry_set_t mVisibleEntries; //must-be-created visible entries wait for objects creation. LLVOCacheEntry::vocache_entry_priority_list_t mWaitingList; //transient list storing sorted visible entries waiting for object creation. @@ -943,23 +942,6 @@ void LLViewerRegion::addVisibleCacheEntry(LLVOCacheEntry* entry) mImpl->mVisibleEntries.insert(entry); } -bool LLViewerRegion::hasVisibleGroup(LLviewerOctreeGroup* group) -{ - return mImpl->mVisibleGroups.find(group) != mImpl->mVisibleGroups.end(); -} - -void LLViewerRegion::clearVisibleGroup(LLviewerOctreeGroup* group) -{ - if(mDead) - { - return; - } - - llassert(!group->getOctreeNode() || group->isEmpty()); - - mImpl->mVisibleGroups.erase(group); -} - F32 LLViewerRegion::updateVisibleEntries(F32 max_time) { if(mImpl->mVisibleGroups.empty() && mImpl->mVisibleEntries.empty()) @@ -1030,11 +1012,12 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time) #endif //process visible groups - std::set< LLviewerOctreeGroup* >::iterator group_iter = mImpl->mVisibleGroups.begin(); + std::set< LLPointer<LLviewerOctreeGroup> >::iterator group_iter = mImpl->mVisibleGroups.begin(); for(; group_iter != mImpl->mVisibleGroups.end(); ++group_iter) { - LLviewerOctreeGroup* group = *group_iter; - if(!group->getOctreeNode() || group->isEmpty()) + LLPointer<LLviewerOctreeGroup> group = *group_iter; + if(group->getNumRefs() < 3 || //group to be deleted + !group->getOctreeNode() || group->isEmpty()) //group empty { continue; } @@ -1056,7 +1039,6 @@ F32 LLViewerRegion::updateVisibleEntries(F32 max_time) } } } - mImpl->mVisibleGroups.clear(); if(needs_update) { @@ -1119,8 +1101,6 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time) return did_update; } - sCurRegionp = this; - //kill invisible objects max_update_time = killInvisibleObjects(max_update_time); @@ -1129,7 +1109,6 @@ BOOL LLViewerRegion::idleUpdate(F32 max_update_time) mImpl->mVisibleGroups.clear(); - sCurRegionp = NULL; return did_update; } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index a73898317b..fefd4209aa 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -224,8 +224,6 @@ public: void addActiveCacheEntry(LLVOCacheEntry* entry); void removeActiveCacheEntry(LLVOCacheEntry* entry, LLDrawable* drawablep); void killCacheEntry(U32 local_id); //physically delete the cache entry - void clearVisibleGroup(LLviewerOctreeGroup* group); - bool hasVisibleGroup(LLviewerOctreeGroup* group); // Like idleUpdate, but forces everything to complete regardless of // how long it takes. @@ -396,7 +394,6 @@ public: LLDynamicArray<U32> mMapAvatars; LLDynamicArray<LLUUID> mMapAvatarIDs; - static LLViewerRegion* sCurRegionp; static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not. private: LLViewerRegionImpl * mImpl; |