diff options
author | Richard Linden <none@none> | 2010-07-19 15:15:04 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2010-07-19 15:15:04 -0700 |
commit | 39ae8785b459255f5fcc432cb2b5d5bed3ab2ba9 (patch) | |
tree | 745b1fe5fbe7a8bed81794db5bc6a728867e5c03 /indra/newview/llinventorybridge.cpp | |
parent | b4aed58dec573f057dc80ef083a86302b36d149d (diff) |
EXT-8448 FIX [crashhunters] Crash in LLFolderBridge::folderOptionsMenu()
reviewed by Callum
Diffstat (limited to 'indra/newview/llinventorybridge.cpp')
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 578c68410b..4ac9edecbe 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1444,7 +1444,7 @@ bool LLItemBridge::isRemoveAction(std::string action) const // | LLFolderBridge | // +=================================================+ -LLFolderBridge* LLFolderBridge::sSelf=NULL; +LLHandle<LLFolderBridge> LLFolderBridge::sSelf; // Can be moved to another folder BOOL LLFolderBridge::isItemMovable() const @@ -2388,8 +2388,11 @@ void LLFolderBridge::pasteLinkFromClipboard() void LLFolderBridge::staticFolderOptionsMenu() { - if (!sSelf) return; - sSelf->folderOptionsMenu(); + LLFolderBridge* selfp = sSelf.get(); + if (selfp) + { + selfp->folderOptionsMenu(); + } } void LLFolderBridge::folderOptionsMenu() @@ -2466,11 +2469,15 @@ void LLFolderBridge::folderOptionsMenu() } mItems.push_back(std::string("Outfit Separator")); } - hide_context_entries(*mMenu, mItems, disabled_items, TRUE); + LLMenuGL* menup = dynamic_cast<LLMenuGL*>(mMenu.get()); + if (menup) + { + hide_context_entries(*menup, mItems, disabled_items, TRUE); - // Reposition the menu, in case we're adding items to an existing menu. - mMenu->needsArrange(); - mMenu->arrangeAndClear(); + // Reposition the menu, in case we're adding items to an existing menu. + menup->needsArrange(); + menup->arrangeAndClear(); + } } BOOL LLFolderBridge::checkFolderForContentsOfType(LLInventoryModel* model, LLInventoryCollectFunctor& is_type) @@ -2512,6 +2519,10 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mDisabledItems.push_back(std::string("New Body Parts")); } + // clear out old menu and folder pointers + mMenu.markDead(); + sSelf.markDead(); + if(trash_id == mUUID) { // This is the trash. @@ -2587,9 +2598,8 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { mWearables=TRUE; } - - mMenu = &menu; - sSelf = this; + mMenu = menu.getHandle(); + sSelf = getHandle(); } // Preemptively disable system folder removal if more than one item selected. @@ -2619,6 +2629,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { folders.push_back(category->getUUID()); } + LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(folders, FALSE); fetch->startFetch(); inc_busy_count(); |