summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatarself.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r--indra/newview/llvoavatarself.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index ecd6b05ded..13e28b246a 100644
--- a/indra/newview/llvoavatarself.cpp
+++ b/indra/newview/llvoavatarself.cpp
@@ -510,8 +510,12 @@ BOOL LLVOAvatarSelf::buildMenus()
LLVOAvatarSelf::~LLVOAvatarSelf()
{
- gAgent.setAvatarObject(NULL);
- gAgentWearables.setAvatarObject(NULL);
+ // gAgents pointer might have been set to a different Avatar Self, don't get rid of it if so.
+ if (gAgent.getAvatarObject() == this)
+ {
+ gAgent.setAvatarObject(NULL);
+ gAgentWearables.setAvatarObject(NULL);
+ }
delete mScreenp;
mScreenp = NULL;
}
@@ -1966,6 +1970,7 @@ void LLVOAvatarSelf::forceBakeAllTextures(bool slam_for_debug)
// Don't know if this is needed
updateMeshTextures();
+
}
//-----------------------------------------------------------------------------