summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-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);