From ed351ca9138ea39b78e871716f12483f53795932 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Thu, 13 Aug 2009 16:05:07 +0000 Subject: For DEV-37955 : Broken links possible if linked item is cached but baseobj not cached Major fix to guarantee no broken links. If a link comes through from the cache but its baseobj doesn't also exist in the cache, then don't add the link to memory yet, and uncache the folder. Reviewed by: Nyx, Vir. --- indra/newview/llviewerinventory.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'indra/newview/llviewerinventory.cpp') diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 78e8f084c7..9a090be76a 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1185,6 +1185,17 @@ U32 LLViewerInventoryItem::getCRC32() const return LLInventoryItem::getCRC32(); } +// This returns true if the item that this item points to +// doesn't exist in memory (i.e. LLInventoryModel). The baseitem +// might still be in the database but just not loaded yet. +bool LLViewerInventoryItem::getIsBrokenLink() const +{ + // If the item's type resolves to be a link, that means either: + // A. It wasn't able to perform indirection, i.e. the baseobj doesn't exist in memory. + // B. It's pointing to another link, which is illegal. + return LLAssetType::lookupIsLinkType(getType()); +} + const LLViewerInventoryItem *LLViewerInventoryItem::getLinkedItem() const { if (mType == LLAssetType::AT_LINK) -- cgit v1.2.3