Crashfix regarding LLViewerObject using released regions. V3 cherrypick.
This commit is contained in:
@@ -904,6 +904,13 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys,
|
||||
LLMemType mt(LLMemType::MTYPE_OBJECT);
|
||||
U32 retval = 0x0;
|
||||
|
||||
// If region is removed from the list it is also deleted.
|
||||
if (!LLWorld::instance().isRegionListed(mRegionp))
|
||||
{
|
||||
llwarns << "Updating object in an invalid region" << llendl;
|
||||
return retval;
|
||||
}
|
||||
|
||||
// Coordinates of objects on simulators are region-local.
|
||||
U64 region_handle;
|
||||
mesgsys->getU64Fast(_PREHASH_RegionData, _PREHASH_RegionHandle, region_handle);
|
||||
@@ -3556,7 +3563,8 @@ LLNameValue *LLViewerObject::getNVPair(const std::string& name) const
|
||||
|
||||
void LLViewerObject::updatePositionCaches() const
|
||||
{
|
||||
if(mRegionp)
|
||||
// If region is removed from the list it is also deleted.
|
||||
if(mRegionp && LLWorld::instance().isRegionListed(mRegionp))
|
||||
{
|
||||
if (!isRoot())
|
||||
{
|
||||
@@ -3573,7 +3581,8 @@ void LLViewerObject::updatePositionCaches() const
|
||||
|
||||
const LLVector3d LLViewerObject::getPositionGlobal() const
|
||||
{
|
||||
if(mRegionp)
|
||||
// If region is removed from the list it is also deleted.
|
||||
if(mRegionp && LLWorld::instance().isRegionListed(mRegionp))
|
||||
{
|
||||
LLVector3d position_global = mRegionp->getPosGlobalFromRegion(getPositionRegion());
|
||||
|
||||
@@ -3592,7 +3601,8 @@ const LLVector3d LLViewerObject::getPositionGlobal() const
|
||||
|
||||
const LLVector3 &LLViewerObject::getPositionAgent() const
|
||||
{
|
||||
if (mRegionp)
|
||||
// If region is removed from the list it is also deleted.
|
||||
if(mRegionp && LLWorld::instance().isRegionListed(mRegionp))
|
||||
{
|
||||
if (mDrawable.notNull() && (!mDrawable->isRoot() && getParent()))
|
||||
{
|
||||
|
||||
@@ -1486,6 +1486,11 @@ void LLWorld::getAvatars(std::vector<LLUUID>* avatar_ids, std::vector<LLVector3d
|
||||
}
|
||||
}
|
||||
|
||||
bool LLWorld::isRegionListed(const LLViewerRegion* region) const
|
||||
{
|
||||
region_list_t::const_iterator it = find(mRegionList.begin(), mRegionList.end(), region);
|
||||
return it != mRegionList.end();
|
||||
}
|
||||
|
||||
LLHTTPRegistration<LLEstablishAgentCommunication>
|
||||
gHTTPRegistrationEstablishAgentCommunication(
|
||||
|
||||
@@ -163,6 +163,11 @@ public:
|
||||
std::vector<LLVector3d>* positions = NULL,
|
||||
const LLVector3d& relative_to = LLVector3d(), F32 radius = FLT_MAX) const;
|
||||
|
||||
// Returns 'true' if the region is in mRegionList,
|
||||
// 'false' if the region has been removed due to region change
|
||||
// or if the circuit to this simulator had been lost.
|
||||
bool isRegionListed(const LLViewerRegion* region) const;
|
||||
|
||||
private:
|
||||
region_list_t mActiveRegionList;
|
||||
region_list_t mRegionList;
|
||||
|
||||
Reference in New Issue
Block a user