summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-11-26 17:44:54 -0700
committerXiaohong Bao <bao@lindenlab.com>2013-11-26 17:44:54 -0700
commitd8e92867162f8c4ff9489d8eefde53546e907dff (patch)
tree4c67e73acfb0988213965f90bc9cc85ae114afbb
parent04aece3282025ed0f117a9ade96edc0bf906b3cf (diff)
fix for SH-4637: Viewer-Interesting crashes if you teleport after crossing a region border.
-rwxr-xr-xindra/newview/llspatialpartition.cpp14
-rw-r--r--indra/newview/llvieweroctree.cpp6
2 files changed, 9 insertions, 11 deletions
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);