fix for SH-4637: Viewer-Interesting crashes if you teleport after crossing a region border.

meow-7.2.2
Xiaohong Bao 2013-11-26 17:44:54 -07:00
parent 04aece3282
commit d8e9286716
2 changed files with 9 additions and 11 deletions

View File

@ -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;
}
}

View File

@ -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);