summaryrefslogtreecommitdiff
path: root/indra/newview/llvoavatarself.cpp
diff options
context:
space:
mode:
authorMark Palange (Mani) <palange@lindenlab.com>2010-02-05 13:20:16 -0800
committerMark Palange (Mani) <palange@lindenlab.com>2010-02-05 13:20:16 -0800
commit02511c41713da468a5e2620a8bc1bb0fcdfd64da (patch)
tree7ac8039c8b9853017c4dcea1b584f49d35a0ad76 /indra/newview/llvoavatarself.cpp
parent90be7378983c47e13b878eb6a42b99e7c354d68a (diff)
parent4c4925e8afaff67a132ed2b43f916792e7fbb4a8 (diff)
merge
Diffstat (limited to 'indra/newview/llvoavatarself.cpp')
-rw-r--r--indra/newview/llvoavatarself.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp
index b1ea8a1bbb..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;
}