From 830e3ea0ec83070b56b805e43cb3ad261c413802 Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Fri, 15 Mar 2013 16:30:11 -0700 Subject: [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 --- indra/newview/llfavoritesbar.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'indra/newview/llfavoritesbar.cpp') 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(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; } -- cgit v1.2.3 From 5216e9579f05b133b0cbd3fda9d5f7322ed4aacf Mon Sep 17 00:00:00 2001 From: Baker Linden Date: Mon, 18 Mar 2013 11:39:24 -0700 Subject: Found an errant right bracket at the top of the file -- whoopsie! --- indra/newview/llfavoritesbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llfavoritesbar.cpp') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index eb2b4b1ba2..b5f5a1d169 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -1,4 +1,4 @@ -]/** +/** * @file llfavoritesbar.cpp * @brief LLFavoritesBarCtrl class implementation * -- cgit v1.2.3