SL-15245 Multiple guide books open, but cannot close them all

Opening and closing single-instance floaters rapidly and multiple times could result in cleaning instance from floaterreg twice, thus removing new isntance instead of current one
master
Andrey Kleshchev 2021-05-12 14:25:46 +03:00
parent 87f1d6071e
commit 3917de54db
2 changed files with 9 additions and 1 deletions

View File

@ -510,7 +510,12 @@ void LLFloater::destroy()
// virtual
LLFloater::~LLFloater()
{
LLFloaterReg::removeInstance(mInstanceName, mKey);
if (!isDead())
{
// If it's dead, instance is supposed to be already removed, and
// in case of single instance we can remove new one by accident
LLFloaterReg::removeInstance(mInstanceName, mKey);
}
if( gFocusMgr.childHasKeyboardFocus(this))
{

View File

@ -54,6 +54,7 @@ const std::string FLOATER_GUIDEBOOK("guidebook"); // alias for how_to
const std::string FLOATER_HOW_TO("how_to");
const std::string FLOATER_WEB_CONTENT("web_content");
// All arguments are palceholders! Server side will need to add validation first.
// Web content universal argument
const std::string KEY_TRUSTED_CONTENT("trusted_content");
@ -105,6 +106,8 @@ bool LLUrlFloaterDispatchHandler::operator()(const LLDispatcher *, const std::st
}
}
// At the moment command_params is a placeholder and code treats it as map
// Once server side adds argument validation this will be either a map or an array
std::string floater;
LLSD command_params;
std::string url;