Crashfix regarding LLViewerObject using released regions. V3 cherrypick.

This commit is contained in:
Shyotl
2012-05-23 02:10:02 -05:00
parent a2649ceb5a
commit 61013dd2ab
3 changed files with 23 additions and 3 deletions

View File

@@ -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()))
{