From d2b13de633b4719bf61e2905699dd1bb67ae0c36 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 28 Jan 2011 15:57:42 -0800 Subject: STORM-934 POSSIBLE FIX [crashhunters] crash at [2] LLPanelAvatarProfile::got_full_name_callback(LLUUID const &,std::basic_string,std::allocator > const &,bool) [secondlife-bin llpanelavatar.cpp] --- indra/newview/llpanelavatar.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'indra/newview/llpanelavatar.cpp') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 94b2340c93..8a917a082c 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -625,8 +625,13 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g getChild("sl_groups")->setValue(groups); } -void LLPanelAvatarProfile::got_full_name_callback( const LLUUID& id, const std::string& full_name, bool is_group ) -{ +static void got_full_name_callback( LLHandle profile_panel_handle, const std::string& full_name ) +{ + if (profile_panel_handle.isDead() ) return; + + LLPanelAvatarProfile* profile_panel = dynamic_cast(profile_panel_handle.get()); + if ( ! profile_panel ) return; + LLStringUtil::format_map_t args; std::string name; @@ -641,9 +646,9 @@ void LLPanelAvatarProfile::got_full_name_callback( const LLUUID& id, const std:: args["[NAME]"] = name; - std::string linden_name = getString("name_text_args", args); - getChild("name_descr_text")->setValue(linden_name); -} + std::string linden_name = profile_panel->getString("name_text_args", args); + profile_panel->getChild("name_descr_text")->setValue(linden_name); +} void LLPanelAvatarProfile::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { @@ -667,16 +672,17 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) } // ask (asynchronously) for the avatar name + LLHandle profile_panel_handle = getHandle(); std::string full_name; if (gCacheName->getFullName(avatar_data->agent_id, full_name)) { // name in cache, call callback directly - got_full_name_callback( avatar_data->agent_id, full_name, false ); + got_full_name_callback( profile_panel_handle, full_name ); } else { // not in cache, lookup name - gCacheName->get(avatar_data->agent_id, false, boost::bind( &LLPanelAvatarProfile::got_full_name_callback, this, _1, _2, _3 )); + gCacheName->get(avatar_data->agent_id, false, boost::bind( got_full_name_callback, profile_panel_handle, _2 )); } // get display name -- cgit v1.2.3 From 2e2d990eb10d101982b4f1915780a49615b55d6e Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Sat, 29 Jan 2011 13:09:55 -0500 Subject: correct DOS line endings --- indra/newview/llpanelavatar.cpp | 62 ++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 31 deletions(-) (limited to 'indra/newview/llpanelavatar.cpp') diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 94b2340c93..53529b9f8b 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -625,10 +625,10 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g getChild("sl_groups")->setValue(groups); } -void LLPanelAvatarProfile::got_full_name_callback( const LLUUID& id, const std::string& full_name, bool is_group ) -{ - LLStringUtil::format_map_t args; - +void LLPanelAvatarProfile::got_full_name_callback( const LLUUID& id, const std::string& full_name, bool is_group ) +{ + LLStringUtil::format_map_t args; + std::string name; if (LLAvatarNameCache::useDisplayNames()) { @@ -637,21 +637,21 @@ void LLPanelAvatarProfile::got_full_name_callback( const LLUUID& id, const std:: else { name = full_name; - } - - args["[NAME]"] = name; - - std::string linden_name = getString("name_text_args", args); - getChild("name_descr_text")->setValue(linden_name); -} + } + + args["[NAME]"] = name; + + std::string linden_name = getString("name_text_args", args); + getChild("name_descr_text")->setValue(linden_name); +} void LLPanelAvatarProfile::onNameCache(const LLUUID& agent_id, const LLAvatarName& av_name) { - LLStringUtil::format_map_t args; - args["[DISPLAY_NAME]"] = av_name.mDisplayName; - - std::string display_name = getString("display_name_text_args", args); - getChild("display_name_descr_text")->setValue(display_name); + LLStringUtil::format_map_t args; + args["[DISPLAY_NAME]"] = av_name.mDisplayName; + + std::string display_name = getString("display_name_text_args", args); + getChild("display_name_descr_text")->setValue(display_name); } void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) @@ -667,22 +667,22 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data) } // ask (asynchronously) for the avatar name - std::string full_name; - if (gCacheName->getFullName(avatar_data->agent_id, full_name)) - { - // name in cache, call callback directly - got_full_name_callback( avatar_data->agent_id, full_name, false ); - } - else - { - // not in cache, lookup name - gCacheName->get(avatar_data->agent_id, false, boost::bind( &LLPanelAvatarProfile::got_full_name_callback, this, _1, _2, _3 )); - } - - // get display name + std::string full_name; + if (gCacheName->getFullName(avatar_data->agent_id, full_name)) + { + // name in cache, call callback directly + got_full_name_callback( avatar_data->agent_id, full_name, false ); + } + else + { + // not in cache, lookup name + gCacheName->get(avatar_data->agent_id, false, boost::bind( &LLPanelAvatarProfile::got_full_name_callback, this, _1, _2, _3 )); + } + + // get display name LLAvatarNameCache::get(avatar_data->avatar_id, - boost::bind(&LLPanelAvatarProfile::onNameCache, this, _1, _2)); - + boost::bind(&LLPanelAvatarProfile::onNameCache, this, _1, _2)); + args["[AGE]"] = LLDateUtil::ageFromDate( avatar_data->born_on, LLDate::now()); std::string register_date = getString("RegisterDateFormat", args); getChild("register_date")->setValue(register_date ); -- cgit v1.2.3