summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorsimon_linden <none@none>2013-10-14 14:58:27 -0700
committersimon_linden <none@none>2013-10-14 14:58:27 -0700
commit9ccbf6bee8ec178087734bb25c220c0cfcbda052 (patch)
treebbe24c8574d9f45235ca2c656f6ba0908d70bb73 /indra/newview
parentb0a873570e2d8df1241f9b44759da7f803fe3baf (diff)
MAINT-3308 : Crash in viewer with removeMissingBakedTextures() / updateMeshTextures() loop
Reviewed by Kelly
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/llvoavatar.cpp24
-rwxr-xr-xindra/newview/llvoavatarself.cpp8
2 files changed, 20 insertions, 12 deletions
diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp
index f5918a0a5f..f1578a4186 100755
--- a/indra/newview/llvoavatar.cpp
+++ b/indra/newview/llvoavatar.cpp
@@ -6453,7 +6453,7 @@ void LLVOAvatar::updateMeshTextures()
LLViewerTexLayerSet* layerset = getTexLayerSet(i);
if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() )
- {
+ {
LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID);
mBakedTextureDatas[i].mIsUsed = TRUE;
@@ -6462,12 +6462,12 @@ void LLVOAvatar::updateMeshTextures()
avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin();
avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end();
for (; iter != end; ++iter)
- {
+ {
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setTexture( baked_img );
- }
+ }
}
}
else if (!isUsingLocalAppearance() && is_layer_baked[i])
@@ -6511,7 +6511,7 @@ void LLVOAvatar::updateMeshTextures()
if (mesh)
{
mesh->setLayerSet( layerset );
- }
+ }
}
}
else
@@ -6533,7 +6533,7 @@ void LLVOAvatar::updateMeshTextures()
{
LLAvatarJointMesh* mesh = (*iter);
if (mesh)
- {
+ {
mesh->setColor( color );
mesh->setTexture( hair_img );
}
@@ -6561,7 +6561,15 @@ void LLVOAvatar::updateMeshTextures()
}
}
}
- removeMissingBakedTextures();
+
+ // removeMissingBakedTextures() will call back into this rountine if something is removed, and can blow up the stack
+ static bool call_remove_missing = true;
+ if (call_remove_missing)
+ {
+ call_remove_missing = false;
+ removeMissingBakedTextures(); // May call back into this function if anything is removed
+ call_remove_missing = true;
+ }
}
// virtual
@@ -7778,7 +7786,7 @@ void LLVOAvatar::setIsUsingServerBakes(BOOL newval)
// virtual
void LLVOAvatar::removeMissingBakedTextures()
- {
+{
}
//virtual
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index 9ce99444d9..4e93c93fd2 100755
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -847,7 +847,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures()
if (!tex || tex->isMissingAsset())
{
LLViewerTexture *imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR);
- if (imagep)
+ if (imagep && imagep != tex)
{
setTEImage(te, imagep);
removed = TRUE;
@@ -863,13 +863,13 @@ void LLVOAvatarSelf::removeMissingBakedTextures()
layerset->setUpdatesEnabled(TRUE);
invalidateComposite(layerset, FALSE);
}
- updateMeshTextures();
+ updateMeshTextures(); // may call back into this function
if (getRegion() && !getRegion()->getCentralBakeVersion())
{
- requestLayerSetUploads();
+ requestLayerSetUploads();
+ }
}
}
-}
//virtual
void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp)