diff options
author | Dave Parks <davep@lindenlab.com> | 2012-02-13 19:13:22 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2012-02-13 19:13:22 -0600 |
commit | ca179444a1fb56bb42896c735b23906460c40d88 (patch) | |
tree | 38e44580db7ec792b283cd9e904aebf26f394a0f /indra/newview | |
parent | 041f1c1b03e2eee5d08c2b37883ebf5d5f9671df (diff) |
SH-2973 Potential fix for crash in ~LLVOAvatarSelf
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llappviewer.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lldriverparam.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.cpp | 5 | ||||
-rw-r--r-- | indra/newview/llvoavatarself.h | 2 | ||||
-rw-r--r-- | indra/newview/llwearable.cpp | 2 |
5 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 49fbdbf1df..3a257e1f1c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1769,6 +1769,8 @@ bool LLAppViewer::cleanup() LLAvatarIconIDCache::getInstance()->save(); + gAgentAvatarp = NULL; + LLViewerMedia::saveCookieFile(); // Stop the plugin read thread if it's running. diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp index 8f47d3c5e5..64eb11fc9b 100644 --- a/indra/newview/lldriverparam.cpp +++ b/indra/newview/lldriverparam.cpp @@ -139,7 +139,7 @@ void LLDriverParamInfo::toStream(std::ostream &out) } else { - llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp << " for driver parameter " << getID() << llendl; + llwarns << "could not get parameter " << driven.mDrivenID << " from avatar " << gAgentAvatarp.get() << " for driver parameter " << getID() << llendl; } out << std::endl; } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index f1df67494f..e525d6bad0 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -66,10 +66,11 @@ #include <boost/lexical_cast.hpp> -LLVOAvatarSelf *gAgentAvatarp = NULL; +LLPointer<LLVOAvatarSelf> gAgentAvatarp = NULL; + BOOL isAgentAvatarValid() { - return (gAgentAvatarp && + return (gAgentAvatarp.notNull() && (gAgentAvatarp->getRegion() != NULL) && (!gAgentAvatarp->isDead())); } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 54dbe81993..655fb3a012 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -383,7 +383,7 @@ private: }; -extern LLVOAvatarSelf *gAgentAvatarp; +extern LLPointer<LLVOAvatarSelf> gAgentAvatarp; BOOL isAgentAvatarValid(); diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index d8aa0b7d5c..0f7f63061b 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -221,7 +221,7 @@ void LLWearable::createVisualParams() param->resetDrivenParams(); if(!param->linkDrivenParams(boost::bind(wearable_function,(LLWearable*)this, _1), false)) { - if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp,_1 ), true)) + if( !param->linkDrivenParams(boost::bind(avatar_function,gAgentAvatarp.get(),_1 ), true)) { llwarns << "could not link driven params for wearable " << getName() << " id: " << param->getID() << llendl; continue; |