diff options
author | Loren Shih <seraph@lindenlab.com> | 2009-08-13 16:05:07 +0000 |
---|---|---|
committer | Loren Shih <seraph@lindenlab.com> | 2009-08-13 16:05:07 +0000 |
commit | ed351ca9138ea39b78e871716f12483f53795932 (patch) | |
tree | 3b673855b968f391abd15b3c4f8428104f1a2307 /indra/newview/llviewerinventory.cpp | |
parent | 953aec0613081686f7a56af0e9255f4ce15cf9cc (diff) |
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.
Diffstat (limited to 'indra/newview/llviewerinventory.cpp')
-rw-r--r-- | indra/newview/llviewerinventory.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
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) |