diff options
author | Xiaohong Bao <bao@lindenlab.com> | 2014-02-05 15:54:40 -0700 |
---|---|---|
committer | Xiaohong Bao <bao@lindenlab.com> | 2014-02-05 15:54:40 -0700 |
commit | cd9871197c55395f6943c2911e9a7991540adfa4 (patch) | |
tree | ab0f98ff8c0b15c84891d51e068df88b8a61332e | |
parent | e2d14cfd474aceae95a3391e7c8d79e20e734474 (diff) |
fix a memory crash caused by accessing deleted pointers.
-rwxr-xr-x | indra/newview/llvocache.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index 6cf6028ae0..26f6987916 100755 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -589,14 +589,14 @@ void LLVOCacheEntry::updateParentBoundingInfo(const LLVOCacheEntry* child) //------------------------------------------------------------------- LLVOCacheGroup::~LLVOCacheGroup() { - for(S32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - if(mOcclusionState[i] & ACTIVE_OCCLUSION) - { - ((LLVOCachePartition*)mSpatialPartition)->removeOccluder(this); - break; - } - } + //for(S32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + //{ + // if(mOcclusionState[i] & ACTIVE_OCCLUSION) + // { + // ((LLVOCachePartition*)mSpatialPartition)->removeOccluder(this); + // break; + // } + //} } //virtual @@ -979,7 +979,11 @@ void LLVOCachePartition::processOccluders(LLCamera* camera) group->doOcclusion(camera, &shift); group->clearOcclusionState(LLOcclusionCullingGroup::ACTIVE_OCCLUSION); } - } + } + + //safe to clear mOccludedGroups here because only the world camera accesses it. + mOccludedGroups.clear(); + sNeedsOcclusionCheck = FALSE; } void LLVOCachePartition::resetOccluders() |