Modernize LLSelectMgr and fix leaks

This commit is contained in:
Inusaito Sayori
2013-10-18 08:20:19 -04:00
parent 4feb1985b0
commit ec5aaa2af8
2 changed files with 11 additions and 12 deletions

View File

@@ -214,7 +214,6 @@ LLSelectMgr::LLSelectMgr()
mGridMode = GRID_MODE_WORLD;
gSavedSettings.setS32("GridMode", (S32)GRID_MODE_WORLD);
mGridValid = FALSE;
mSelectedObjects = new LLObjectSelection();
mHoverObjects = new LLObjectSelection();
@@ -1202,7 +1201,6 @@ void LLSelectMgr::setGridMode(EGridMode mode)
mGridMode = mode;
gSavedSettings.setS32("GridMode", mode);
updateSelectionCenter();
mGridValid = FALSE;
}
void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &scale)
@@ -1303,7 +1301,6 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
origin = mGridOrigin;
rotation = mGridRotation;
scale = mGridScale;
mGridValid = TRUE;
}
//-----------------------------------------------------------------------------
@@ -3410,13 +3407,13 @@ bool LLSelectMgr::confirmDelete(const LLSD& notification, const LLSD& response,
case 0:
{
// TODO: Make sure you have delete permissions on all of them.
LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
// attempt to derez into the trash.
LLDeRezInfo* info = new LLDeRezInfo(DRD_TRASH, trash_id);
LLDeRezInfo info(DRD_TRASH, trash_id);
LLSelectMgr::getInstance()->sendListToRegions("DeRezObject",
packDeRezHeader,
packObjectLocalID,
(void*)info,
(void*) &info,
SEND_ONLY_ROOTS);
// VEFFECT: Delete Object - one effect for all deletes
if(!gSavedSettings.getBOOL("DisablePointAtAndBeam"))
@@ -4164,13 +4161,15 @@ void LLSelectMgr::deselectAllIfTooFar()
void LLSelectMgr::selectionSetObjectName(const std::string& name)
{
std::string name_copy(name);
// we only work correctly if 1 object is selected.
if(mSelectedObjects->getRootObjectCount() == 1)
{
sendListToRegions("ObjectName",
packAgentAndSessionID,
packObjectName,
(void*)(new std::string(name)),
(void*)(&name_copy),
SEND_ONLY_ROOTS);
}
else if(mSelectedObjects->getObjectCount() == 1)
@@ -4178,20 +4177,22 @@ void LLSelectMgr::selectionSetObjectName(const std::string& name)
sendListToRegions("ObjectName",
packAgentAndSessionID,
packObjectName,
(void*)(new std::string(name)),
(void*)(&name_copy),
SEND_INDIVIDUALS);
}
}
void LLSelectMgr::selectionSetObjectDescription(const std::string& desc)
{
std::string desc_copy(desc);
// we only work correctly if 1 object is selected.
if(mSelectedObjects->getRootObjectCount() == 1)
{
sendListToRegions("ObjectDescription",
packAgentAndSessionID,
packObjectDescription,
(void*)(new std::string(desc)),
(void*)(&desc_copy),
SEND_ONLY_ROOTS);
}
else if(mSelectedObjects->getObjectCount() == 1)
@@ -4199,7 +4200,7 @@ void LLSelectMgr::selectionSetObjectDescription(const std::string& desc)
sendListToRegions("ObjectDescription",
packAgentAndSessionID,
packObjectDescription,
(void*)(new std::string(desc)),
(void*)(&desc_copy),
SEND_INDIVIDUALS);
}
}
@@ -4726,7 +4727,6 @@ void LLSelectMgr::packObjectName(LLSelectNode* node, void* user_data)
gMessageSystem->addU32Fast(_PREHASH_LocalID, node->getObject()->getLocalID());
gMessageSystem->addStringFast(_PREHASH_Name, *name);
}
delete name;
}
// static