diff options
author | Baker Linden <baker@lindenlab.com> | 2013-03-15 16:30:11 -0700 |
---|---|---|
committer | Baker Linden <baker@lindenlab.com> | 2013-03-15 16:30:11 -0700 |
commit | 830e3ea0ec83070b56b805e43cb3ad261c413802 (patch) | |
tree | f2982f9050b9cca9070d96a7edea950f298844a7 /indra/newview | |
parent | e87000ba0750e55d9d6b55feccc4124f5d2b4b74 (diff) |
[MAINT-2386] Viewer crashes when user move landmarks from Inventory -> Landmarks or Places to Favorite bar
- Fixed a bug where the viewer would crash when adding multiple landmarks to an empty favorites bar
[Reviewer] Kelly
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfavoritesbar.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 4cbc9cab4a..eb2b4b1ba2 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1,4 +1,4 @@ -/** +]/** * @file llfavoritesbar.cpp * @brief LLFavoritesBarCtrl class implementation * @@ -546,6 +546,10 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con bool insert_before = true; if (!mItems.empty()) { + // [MAINT-2386] When multiple landmarks are selected and dragged onto an empty favorites bar, + // the viewer would crash when casting mLastTab below, as mLastTab is still null when the + // second landmark is being added. + // To ensure mLastTab is valid, we need to call updateButtons() at the end of this function dest = dynamic_cast<LLFavoriteLandmarkButton*>(mLandingTab); if (!dest) { @@ -616,6 +620,11 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con cb); } + // [MAINT-2386] Ensure the favorite button has been created and is valid. + // This also ensures that mLastTab will be valid when dropping multiple + // landmarks to an empty favorites bar. + updateButtons(); + llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl; } |