Fix rare shutdown crash in LLViewerObjectList
parent
3887404678
commit
7d2cd036ea
|
|
@ -3602,7 +3602,7 @@ void process_kill_object(LLMessageSystem *mesgsys, void **user_data)
|
|||
U32 local_id;
|
||||
mesgsys->getU32Fast(_PREHASH_ObjectData, _PREHASH_ID, local_id, i);
|
||||
|
||||
LLViewerObjectList::getUUIDFromLocal(id, local_id, ip, port);
|
||||
gObjectList.getUUIDFromLocal(id, local_id, ip, port);
|
||||
if (id == LLUUID::null)
|
||||
{
|
||||
LL_DEBUGS("Messaging") << "Unknown kill for local " << local_id << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -1940,14 +1940,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
|
||||
if(mesgsys != NULL)
|
||||
{
|
||||
LLViewerObjectList::getUUIDFromLocal(parent_uuid,
|
||||
gObjectList.getUUIDFromLocal(parent_uuid,
|
||||
parent_id,
|
||||
mesgsys->getSenderIP(),
|
||||
mesgsys->getSenderPort());
|
||||
}
|
||||
else
|
||||
{
|
||||
LLViewerObjectList::getUUIDFromLocal(parent_uuid,
|
||||
gObjectList.getUUIDFromLocal(parent_uuid,
|
||||
parent_id,
|
||||
mRegionp->getHost().getAddress(),
|
||||
mRegionp->getHost().getPort());
|
||||
|
|
@ -2062,7 +2062,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
|
||||
// Debugging for suspected problems with local ids.
|
||||
//LLUUID parent_uuid;
|
||||
//LLViewerObjectList::getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() );
|
||||
//gObjectList.getUUIDFromLocal(parent_uuid, parent_id, mesgsys->getSenderIP(), mesgsys->getSenderPort() );
|
||||
//if (parent_uuid != cur_parentp->getID() )
|
||||
//{
|
||||
// LL_ERRS() << "Local ID match but UUID mismatch of viewer object" << LL_ENDL;
|
||||
|
|
@ -2085,14 +2085,14 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
|||
|
||||
if(mesgsys != NULL)
|
||||
{
|
||||
LLViewerObjectList::getUUIDFromLocal(parent_uuid,
|
||||
gObjectList.getUUIDFromLocal(parent_uuid,
|
||||
parent_id,
|
||||
gMessageSystem->getSenderIP(),
|
||||
gMessageSystem->getSenderPort());
|
||||
}
|
||||
else
|
||||
{
|
||||
LLViewerObjectList::getUUIDFromLocal(parent_uuid,
|
||||
gObjectList.getUUIDFromLocal(parent_uuid,
|
||||
parent_id,
|
||||
mRegionp->getHost().getAddress(),
|
||||
mRegionp->getHost().getPort());
|
||||
|
|
|
|||
|
|
@ -99,8 +99,6 @@ extern LLPipeline gPipeline;
|
|||
|
||||
// Statics for object lookup tables.
|
||||
U32 LLViewerObjectList::sSimulatorMachineIndex = 1; // Not zero deliberately, to speed up index check.
|
||||
std::map<U64, U32> LLViewerObjectList::sIPAndPortToIndex;
|
||||
std::map<U64, LLUUID> LLViewerObjectList::sIndexAndLocalIDToUUID;
|
||||
|
||||
LLViewerObjectList::LLViewerObjectList()
|
||||
{
|
||||
|
|
@ -138,17 +136,17 @@ void LLViewerObjectList::getUUIDFromLocal(LLUUID &id,
|
|||
{
|
||||
U64 ipport = (((U64)ip) << 32) | (U64)port;
|
||||
|
||||
U32 index = sIPAndPortToIndex[ipport];
|
||||
U32 index = mIPAndPortToIndex[ipport];
|
||||
|
||||
if (!index)
|
||||
{
|
||||
index = sSimulatorMachineIndex++;
|
||||
sIPAndPortToIndex[ipport] = index;
|
||||
mIPAndPortToIndex[ipport] = index;
|
||||
}
|
||||
|
||||
U64 indexid = (((U64)index) << 32) | (U64)local_id;
|
||||
|
||||
id = get_if_there(sIndexAndLocalIDToUUID, indexid, LLUUID::null);
|
||||
id = get_if_there(mIndexAndLocalIDToUUID, indexid, LLUUID::null);
|
||||
}
|
||||
|
||||
U64 LLViewerObjectList::getIndex(const U32 local_id,
|
||||
|
|
@ -157,7 +155,7 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
|
|||
{
|
||||
U64 ipport = (((U64)ip) << 32) | (U64)port;
|
||||
|
||||
U32 index = sIPAndPortToIndex[ipport];
|
||||
U32 index = mIPAndPortToIndex[ipport];
|
||||
|
||||
if (!index)
|
||||
{
|
||||
|
|
@ -177,14 +175,14 @@ bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
|
|||
U32 ip = objectp->getRegion()->getHost().getAddress();
|
||||
U32 port = objectp->getRegion()->getHost().getPort();
|
||||
U64 ipport = (((U64)ip) << 32) | (U64)port;
|
||||
U32 index = sIPAndPortToIndex[ipport];
|
||||
U32 index = mIPAndPortToIndex[ipport];
|
||||
|
||||
// LL_INFOS() << "Removing object from table, local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
|
||||
|
||||
U64 indexid = (((U64)index) << 32) | (U64)local_id;
|
||||
|
||||
std::map<U64, LLUUID>::iterator iter = sIndexAndLocalIDToUUID.find(indexid);
|
||||
if (iter == sIndexAndLocalIDToUUID.end())
|
||||
std::map<U64, LLUUID>::iterator iter = mIndexAndLocalIDToUUID.find(indexid);
|
||||
if (iter == mIndexAndLocalIDToUUID.end())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -192,7 +190,7 @@ bool LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
|
|||
// Found existing entry
|
||||
if (iter->second == objectp->getID())
|
||||
{ // Full UUIDs match, so remove the entry
|
||||
sIndexAndLocalIDToUUID.erase(iter);
|
||||
mIndexAndLocalIDToUUID.erase(iter);
|
||||
return true;
|
||||
}
|
||||
// UUIDs did not match - this would zap a valid entry, so don't erase it
|
||||
|
|
@ -210,17 +208,17 @@ void LLViewerObjectList::setUUIDAndLocal(const LLUUID &id,
|
|||
{
|
||||
U64 ipport = (((U64)ip) << 32) | (U64)port;
|
||||
|
||||
U32 index = sIPAndPortToIndex[ipport];
|
||||
U32 index = mIPAndPortToIndex[ipport];
|
||||
|
||||
if (!index)
|
||||
{
|
||||
index = sSimulatorMachineIndex++;
|
||||
sIPAndPortToIndex[ipport] = index;
|
||||
mIPAndPortToIndex[ipport] = index;
|
||||
}
|
||||
|
||||
U64 indexid = (((U64)index) << 32) | (U64)local_id;
|
||||
|
||||
sIndexAndLocalIDToUUID[indexid] = id;
|
||||
mIndexAndLocalIDToUUID[indexid] = id;
|
||||
|
||||
//LL_INFOS() << "Adding object to table, full ID " << id
|
||||
// << ", local ID " << local_id << ", ip " << ip << ":" << port << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -171,18 +171,18 @@ public:
|
|||
// used to discount stats from this frame
|
||||
bool mWasPaused;
|
||||
|
||||
static void getUUIDFromLocal(LLUUID &id,
|
||||
void getUUIDFromLocal(LLUUID &id,
|
||||
const U32 local_id,
|
||||
const U32 ip,
|
||||
const U32 port);
|
||||
static void setUUIDAndLocal(const LLUUID &id,
|
||||
void setUUIDAndLocal(const LLUUID &id,
|
||||
const U32 local_id,
|
||||
const U32 ip,
|
||||
const U32 port); // Requires knowledge of message system info!
|
||||
|
||||
static bool removeFromLocalIDTable(const LLViewerObject* objectp);
|
||||
bool removeFromLocalIDTable(const LLViewerObject* objectp);
|
||||
// Used ONLY by the orphaned object code.
|
||||
static U64 getIndex(const U32 local_id, const U32 ip, const U32 port);
|
||||
U64 getIndex(const U32 local_id, const U32 ip, const U32 port);
|
||||
|
||||
S32 mNumUnknownUpdates;
|
||||
S32 mNumDeadObjectUpdates;
|
||||
|
|
@ -216,9 +216,9 @@ protected:
|
|||
S32 mCurLazyUpdateIndex;
|
||||
|
||||
static U32 sSimulatorMachineIndex;
|
||||
static std::map<U64, U32> sIPAndPortToIndex;
|
||||
std::map<U64, U32> mIPAndPortToIndex;
|
||||
|
||||
static std::map<U64, LLUUID> sIndexAndLocalIDToUUID;
|
||||
std::map<U64, LLUUID> mIndexAndLocalIDToUUID;
|
||||
|
||||
friend class LLViewerObject;
|
||||
|
||||
|
|
@ -257,7 +257,7 @@ extern LLViewerObjectList gObjectList;
|
|||
*/
|
||||
inline LLViewerObject *LLViewerObjectList::findObject(const LLUUID &id)
|
||||
{
|
||||
std::map<LLUUID, LLPointer<LLViewerObject> >::iterator iter = mUUIDObjectMap.find(id);
|
||||
auto iter = mUUIDObjectMap.find(id);
|
||||
if(iter != mUUIDObjectMap.end())
|
||||
{
|
||||
return iter->second;
|
||||
|
|
|
|||
Loading…
Reference in New Issue