summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLoren Shih <seraph@lindenlab.com>2010-01-22 10:48:24 -0500
committerLoren Shih <seraph@lindenlab.com>2010-01-22 10:48:24 -0500
commitc64638dc2114a91b8efb17c1e37481ce34df84d5 (patch)
tree05128715587ff25cc69b8f25195d2ee89647270c /indra
parentaf2f61af502d483011a8f6722686a2c343bd0f7d (diff)
EXT-4492 Deleting gestures from the wearing tab causes the viewer to crash
Revert removal of "delete" option from last checkin. Now enabling "delete" but checking if *this was deleted within removeItem().
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llinventorybridge.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 1c88658920..df089cb0f9 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -575,34 +575,17 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id,
}
}
- // Don't add a separator unless we have at least one entry beneath it,
- // to avoid double separators.
- BOOL separator_pasted = FALSE;
+ items.push_back(std::string("Paste Separator"));
if (obj && obj->getIsLinkType() && !get_is_item_worn(mUUID))
{
- if (!separator_pasted)
- {
- items.push_back(std::string("Paste Separator"));
- separator_pasted = TRUE;
- }
items.push_back(std::string("Remove Link"));
}
- // Hide the delete button from the COF. Detaching/removing/etc. an item in the COF
- // will naturally delete it. This prevents double delete crash possibilities.
- if (!isCOFFolder())
+ items.push_back(std::string("Delete"));
+ if (!isItemRemovable())
{
- if (!separator_pasted)
- {
- items.push_back(std::string("Paste Separator"));
- separator_pasted = TRUE;
- }
- items.push_back(std::string("Delete"));
- if (!isItemRemovable())
- {
- disabled_items.push_back(std::string("Delete"));
- }
+ disabled_items.push_back(std::string("Delete"));
}
// If multiple items are selected, disable properties (if it exists).
@@ -3827,8 +3810,25 @@ void LLGestureBridge::openItem()
BOOL LLGestureBridge::removeItem()
{
- // Force close the preview window, if it exists
- LLGestureManager::instance().deactivateGesture(mUUID);
+ // Grab class information locally since *this may be deleted
+ // within this function. Not a great pattern...
+ const LLInventoryModel* model = getInventoryModel();
+ if(!model)
+ {
+ return FALSE;
+ }
+ const LLUUID item_id = mUUID;
+
+ // This will also force close the preview window, if it exists.
+ // This may actually delete *this, if mUUID is in the COF.
+ LLGestureManager::instance().deactivateGesture(item_id);
+
+ // If deactivateGesture deleted *this, then return out immediately.
+ if (!model->getObject(item_id))
+ {
+ return TRUE;
+ }
+
return LLItemBridge::removeItem();
}