Fix crash when granting/removing build rights to others.

Bug was introduced in c701c61566
for single persons, but already existed for when granting rights
to more than one person at a time.

There is still a problem left now that you have to confirm
several times (once, but also had to confirm two or three times)
before it gets through. That doesn't seem related to THIS bug,
but seems to be a new bug, possibly introduced in the same commit
mentioned above.
This commit is contained in:
Aleric Inglewood
2013-06-10 16:07:45 +02:00
parent e59cefa0cc
commit aca39d8c11

View File

@@ -1064,7 +1064,11 @@ void LLPanelFriends::onClickPay(void* user_data)
void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke command)
{
if (rights.empty()) return;
// Make a copy on the heap: rights is allocated on the stack.
// This copy will be deleted in LLPanelFriends::modifyRightsConfirmation.
rights_map_t* heap_rights = new rights_map_t(rights);
// for single friend, show their name
if (rights.size() == 1)
{
@@ -1078,14 +1082,14 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke comm
LLNotificationsUtil::add("GrantModifyRights",
args,
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, &rights));
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
}
else
{
LLNotificationsUtil::add("RevokeModifyRights",
args,
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, &rights));
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
}
}
else
@@ -1095,14 +1099,14 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke comm
LLNotificationsUtil::add("GrantModifyRightsMultiple",
LLSD(),
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, &rights));
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
}
else
{
LLNotificationsUtil::add("RevokeModifyRightsMultiple",
LLSD(),
LLSD(),
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, &rights));
boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights));
}
}
}