From d8e92867162f8c4ff9489d8eefde53546e907dff Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Tue, 26 Nov 2013 17:44:54 -0700 Subject: fix for SH-4637: Viewer-Interesting crashes if you teleport after crossing a region border. --- indra/newview/llspatialpartition.cpp | 14 +++----------- indra/newview/llvieweroctree.cpp | 6 ++++++ 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 86d1948baa..7b894d8d98 100755 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -840,9 +840,9 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) { return; } - setState(DEAD); - - for (element_iter i = getDataBegin(); getElementCount() > 0 && i != getDataEnd();) + setState(DEAD); + + for (element_iter i = getDataBegin(); i != getDataEnd(); ++i) { LLViewerOctreeEntry* entry = *i; @@ -852,14 +852,6 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node) { ((LLDrawable*)entry->getDrawable())->setGroup(NULL); } - else - { - LL_ERRS() << "No Drawable found in the entry." << LL_ENDL; - } - } - else - { - ++i; } } diff --git a/indra/newview/llvieweroctree.cpp b/indra/newview/llvieweroctree.cpp index 201677b3de..ff8f4d2434 100644 --- a/indra/newview/llvieweroctree.cpp +++ b/indra/newview/llvieweroctree.cpp @@ -481,6 +481,12 @@ bool LLViewerOctreeGroup::removeFromGroup(LLViewerOctreeEntry* entry) { llassert(entry != NULL); llassert(!entry->getGroup()); + + if(isDead()) //group is about to be destroyed, not need to double delete the entry. + { + entry->setBinIndex(-1); + return true; + } unbound(); setState(OBJECT_DIRTY); -- cgit v1.2.3