Skip to content
Snippets Groups Projects
Commit b658e411 authored by Andrew Dyukov's avatar Andrew Dyukov
Browse files

Fixed normal bug EXT-6464 (Buy pass from popup menu doesn't work).

- The bug was caused by deselection of parcel(because of zero ref count to parcel selection) after appearance of alert with ok/cancel.
Added setting pointer to this selection before notification appearance and nullifying pointer it after user chooses ok or cancel. Nullifying
will always take place because alert is modal, so there is no chance that LLPanelLandGeneral::cbBuyPass() won't be called.

Reviewed by Mike at https://codereview.productengine.com/secondlife/r/180/

--HG--
branch : product-engine
parent cf94709c
No related branches found
No related tags found
No related merge requests found
...@@ -90,6 +90,7 @@ static std::string MATURITY = "[MATURITY]"; ...@@ -90,6 +90,7 @@ static std::string MATURITY = "[MATURITY]";
// constants used in callbacks below - syntactic sugar. // constants used in callbacks below - syntactic sugar.
static const BOOL BUY_GROUP_LAND = TRUE; static const BOOL BUY_GROUP_LAND = TRUE;
static const BOOL BUY_PERSONAL_LAND = FALSE; static const BOOL BUY_PERSONAL_LAND = FALSE;
LLPointer<LLParcelSelection> LLPanelLandGeneral::sSelectionForBuyPass = NULL;
// Statics // Statics
LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL; LLParcelSelectionObserver* LLFloaterLand::sObserver = NULL;
...@@ -974,6 +975,8 @@ void LLPanelLandGeneral::onClickBuyPass(void* data) ...@@ -974,6 +975,8 @@ void LLPanelLandGeneral::onClickBuyPass(void* data)
args["PARCEL_NAME"] = parcel_name; args["PARCEL_NAME"] = parcel_name;
args["TIME"] = time; args["TIME"] = time;
// creating pointer on selection to avoid deselection of parcel until we are done with buying pass (EXT-6464)
sSelectionForBuyPass = LLViewerParcelMgr::getInstance()->getParcelSelection();
LLNotificationsUtil::add("LandBuyPass", args, LLSD(), cbBuyPass); LLNotificationsUtil::add("LandBuyPass", args, LLSD(), cbBuyPass);
} }
...@@ -1005,6 +1008,8 @@ bool LLPanelLandGeneral::cbBuyPass(const LLSD& notification, const LLSD& respons ...@@ -1005,6 +1008,8 @@ bool LLPanelLandGeneral::cbBuyPass(const LLSD& notification, const LLSD& respons
// User clicked OK // User clicked OK
LLViewerParcelMgr::getInstance()->buyPass(); LLViewerParcelMgr::getInstance()->buyPass();
} }
// we are done with buying pass, additional selection is no longer needed
sSelectionForBuyPass = NULL;
return false; return false;
} }
......
...@@ -234,6 +234,11 @@ class LLPanelLandGeneral ...@@ -234,6 +234,11 @@ class LLPanelLandGeneral
LLSafeHandle<LLParcelSelection>& mParcel; LLSafeHandle<LLParcelSelection>& mParcel;
// This pointer is needed to avoid parcel deselection until buying pass is completed or canceled.
// Deselection happened because of zero references to parcel selection, which took place when
// "Buy Pass" was called from popup menu(EXT-6464)
static LLPointer<LLParcelSelection> sSelectionForBuyPass;
static LLHandle<LLFloater> sBuyPassDialogHandle; static LLHandle<LLFloater> sBuyPassDialogHandle;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment