From 551411247b8e4701e4768f61717b644750af83a7 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 20 Nov 2012 21:37:04 -0700 Subject: fix a crash caused by object cache for SH-3333. --- indra/newview/llviewerregion.cpp | 2 +- indra/newview/llvocache.cpp | 12 ++++++------ indra/newview/llvocache.h | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 24bd68825b..e275b44e92 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -746,7 +746,7 @@ void LLViewerRegion::replaceCacheEntry(LLVOCacheEntry* old_entry, LLVOCacheEntry if(old_entry) { - new_entry->copy(old_entry); + old_entry->copyTo(new_entry); state = old_entry->getState(); killCacheEntry(old_entry); } diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp index ec8585852b..8ea79dbae6 100644 --- a/indra/newview/llvocache.cpp +++ b/indra/newview/llvocache.cpp @@ -234,20 +234,20 @@ void LLVOCacheEntry::clearBridgeChild() mState &= ~BRIDGE_CHILD; } -void LLVOCacheEntry::copy(LLVOCacheEntry* entry) +void LLVOCacheEntry::copyTo(LLVOCacheEntry* new_entry) { //copy LLViewerOctreeEntry - LLViewerOctreeEntry* oct_entry = entry->getEntry(); - if(!oct_entry) + if(mEntry.notNull()) { - setOctreeEntry(oct_entry); + new_entry->setOctreeEntry(mEntry); + mEntry = NULL; } //copy children - S32 num_children = entry->getNumOfChildren(); + S32 num_children = getNumOfChildren(); for(S32 i = 0; i < num_children; i++) { - addChild(entry->getChild(i)); + new_entry->addChild(getChild(i)); } } diff --git a/indra/newview/llvocache.h b/indra/newview/llvocache.h index ded29dd990..4d058ffdac 100644 --- a/indra/newview/llvocache.h +++ b/indra/newview/llvocache.h @@ -111,7 +111,7 @@ public: void recordHit(); void recordDupe() { mDupeCount++; } - void copy(LLVOCacheEntry* entry); //copy variables + void copyTo(LLVOCacheEntry* new_entry); //copy variables /*virtual*/ void setOctreeEntry(LLViewerOctreeEntry* entry); void addChild(LLVOCacheEntry* entry); -- cgit v1.2.3