a try fix for SH-212: crash at LLViewerObjectList::removeFromLocalIDTable(LLViewerObject const &) [secondlife-bin llviewerobjectlist.cpp] line 173

master
Xiaohong Bao 2010-12-14 12:16:39 -07:00
parent dc75235e38
commit da244c7cce
5 changed files with 17 additions and 17 deletions

View File

@ -46,7 +46,7 @@ public:
/**
* Get host to which to send that capability request.
*/
virtual LLHost getHost() const = 0;
virtual const LLHost& getHost() const = 0;
/**
* Describe this LLCapabilityProvider for logging etc.
*/

View File

@ -159,19 +159,13 @@ U64 LLViewerObjectList::getIndex(const U32 local_id,
return (((U64)index) << 32) | (U64)local_id;
}
BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object)
BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject* objectp)
{
if(object.getRegion())
if(objectp && objectp->getRegion())
{
U32 local_id = object.mLocalID;
LLHost region_host = object.getRegion()->getHost();
if(!region_host.isOk())
{
return FALSE ;
}
U32 ip = region_host.getAddress();
U32 port = region_host.getPort();
U32 local_id = objectp->mLocalID;
U32 ip = objectp->getRegion()->getHost().getAddress();
U32 port = objectp->getRegion()->getHost().getPort();
U64 ipport = (((U64)ip) << 32) | (U64)port;
U32 index = sIPAndPortToIndex[ipport];
@ -186,7 +180,7 @@ BOOL LLViewerObjectList::removeFromLocalIDTable(const LLViewerObject &object)
}
// Found existing entry
if (iter->second == object.getID())
if (iter->second == objectp->getID())
{ // Full UUIDs match, so remove the entry
sIndexAndLocalIDToUUID.erase(iter);
return TRUE;
@ -460,7 +454,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
// << ", regionp " << (U32) regionp << ", object region " << (U32) objectp->getRegion()
// << llendl;
//}
removeFromLocalIDTable(*objectp);
removeFromLocalIDTable(objectp);
setUUIDAndLocal(fullid,
local_id,
gMessageSystem->getSenderIP(),
@ -849,7 +843,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
// << objectp->getRegion()->getHost().getPort() << llendl;
//}
removeFromLocalIDTable(*objectp);
removeFromLocalIDTable(objectp);
if (objectp->onActiveList())
{

View File

@ -161,7 +161,7 @@ public:
const U32 ip,
const U32 port); // Requires knowledge of message system info!
static BOOL removeFromLocalIDTable(const LLViewerObject &object);
static 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);

View File

@ -321,6 +321,12 @@ LLViewerRegion::~LLViewerRegion()
std::for_each(mObjectPartition.begin(), mObjectPartition.end(), DeletePointer());
}
/*virtual*/
const LLHost& LLViewerRegion::getHost() const
{
return mHost;
}
void LLViewerRegion::loadObjectCache()
{
if (mCacheLoaded)

View File

@ -244,7 +244,7 @@ public:
LLEventPump& getCapAPI() { return mCapabilityListener.getCapAPI(); }
/// implements LLCapabilityProvider
virtual LLHost getHost() const { return mHost; }
/*virtual*/ const LLHost& getHost() const;
const U64 &getHandle() const { return mHandle; }
LLSurface &getLand() const { return *mLandp; }