From d8be70e0107bb22b5b8e0aa093a28379884b2ed3 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Sat, 27 Aug 2011 12:57:16 +0300 Subject: STORM-638 FOLLOWUP Fixed a silly pointer usage mistake. --- indra/newview/llviewermenu.cpp | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6b910c7990..26599f557e 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -116,6 +116,8 @@ using namespace LLVOAvatarDefines; +typedef LLPointer LLViewerObjectPtr; + static boost::unordered_map sDefaultItemLabels; BOOL enable_land_build(void*); @@ -4014,7 +4016,7 @@ static bool get_derezzable_objects( EDeRezDestination dest, std::string& error, LLViewerRegion*& first_region, - LLDynamicArray* derez_objectsp, + LLDynamicArray* derez_objectsp, bool only_check = false) { bool found = false; @@ -4093,12 +4095,13 @@ static bool get_derezzable_objects( { found = true; - if (derez_objectsp) - derez_objectsp->put(object); - if (only_check) // one found, no need to traverse to the end break; + + if (derez_objectsp) + derez_objectsp->put(object); + } } @@ -4117,9 +4120,9 @@ static void derez_objects( const LLUUID& dest_id, LLViewerRegion*& first_region, std::string& error, - LLDynamicArray* objectsp) + LLDynamicArray* objectsp) { - LLDynamicArray derez_objects; + LLDynamicArray derez_objects; if (!objectsp) // if objects to derez not specified { @@ -4234,7 +4237,9 @@ private: mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); - get_derezzable_objects(DRD_RETURN_TO_OWNER, mError, mFirstRegion, &mDerezzableObjects); + // Save selected objects, so that we still know what to return after the confirmation dialog resets selection. + get_derezzable_objects(DRD_RETURN_TO_OWNER, mError, mFirstRegion, &mReturnableObjects); + LLNotificationsUtil::add("ReturnToOwner", LLSD(), LLSD(), boost::bind(&LLObjectReturn::onReturnToOwner, this, _1, _2)); return true; } @@ -4245,10 +4250,10 @@ private: if (0 == option) { // Ignore category ID for this derez destination. - derez_objects(DRD_RETURN_TO_OWNER, LLUUID::null, mFirstRegion, mError, &mDerezzableObjects); + derez_objects(DRD_RETURN_TO_OWNER, LLUUID::null, mFirstRegion, mError, &mReturnableObjects); } - mDerezzableObjects.clear(); + mReturnableObjects.clear(); mError.clear(); mFirstRegion = NULL; @@ -4259,7 +4264,7 @@ private: LLObjectSelectionHandle mObjectSelection; - LLDynamicArray mDerezzableObjects; + LLDynamicArray mReturnableObjects; std::string mError; LLViewerRegion* mFirstRegion; }; -- cgit v1.2.3