summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2013-06-19 11:45:44 -0600
committerXiaohong Bao <bao@lindenlab.com>2013-06-19 11:45:44 -0600
commitb38170e6817b3f69274d9b5953584a1278a17ca2 (patch)
tree55c5595c8cd5c12f65cc317937407772d9daaf1a
parent9ed2f4d3cb02d5161bd8bb77cb7befa7feedf2d9 (diff)
fix for SH-4245: Interesting: crash in LLSpatialGroup::handleDestruction
-rwxr-xr-xindra/newview/llspatialpartition.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index 45130efeb9..b9d4c016c2 100755
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -841,11 +841,16 @@ void LLSpatialGroup::handleRemoval(const TreeNode* node, LLViewerOctreeEntry* en
void LLSpatialGroup::handleDestruction(const TreeNode* node)
{
+ if(isDead())
+ {
+ return;
+ }
setState(DEAD);
- for (element_iter i = getDataBegin(); i != getDataEnd(); ++i)
+ for (element_iter i = getDataBegin(); getElementCount() > 0 && i != getDataEnd();)
{
LLViewerOctreeEntry* entry = *i;
+
if (entry->getGroup() == this)
{
if(entry->hasDrawable())
@@ -853,10 +858,14 @@ void LLSpatialGroup::handleDestruction(const TreeNode* node)
((LLDrawable*)entry->getDrawable())->setGroup(NULL);
}
else
- {
+ {
llerrs << "No Drawable found in the entry." << llendl;
}
}
+ else
+ {
+ ++i;
+ }
}
//clean up avatar attachment stats