EXT-4874 : Client freezes on right click - take item

Fixed infinite loop due to parent_id not being incremented properly in loop.
meow-7.2.2
Loren Shih 2010-02-02 20:25:48 -05:00
parent f22fc1e612
commit 85cc9f121d
1 changed files with 5 additions and 1 deletions

View File

@ -317,7 +317,10 @@ BOOL LLInventoryModel::isObjectDescendentOf(const LLUUID& obj_id,
const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(const LLUUID& obj_id) const
{
const LLInventoryObject* obj = getObject(obj_id);
const LLUUID& parent_id = obj->getParentUUID();
// Search up the parent chain until we get to root or an acceptable folder.
// This assumes there are no cycles in the tree else we'll get a hang.
LLUUID parent_id = obj->getParentUUID();
while (!parent_id.isNull())
{
const LLViewerInventoryCategory *cat = getCategory(parent_id);
@ -329,6 +332,7 @@ const LLViewerInventoryCategory *LLInventoryModel::getFirstNondefaultParent(cons
{
return cat;
}
parent_id = cat->getParentUUID();
}
return NULL;
}