From e2418fc4617fca0299efa1c5ea4b7195feb15733 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Tue, 24 Mar 2020 07:04:50 -0400 Subject: [PATCH] Fix some small bugs with coroutine usage to prevent possible use-after-free crashes --- indra/newview/llfloaterabout.cpp | 4 ++-- indra/newview/llviewerdisplayname.cpp | 2 +- indra/newview/llviewerdisplayname.h | 2 +- indra/newview/rlvhandler.cpp | 2 +- indra/newview/rlvhandler.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 171858e4721..0b2b4e1d376 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -105,7 +105,7 @@ class LLFloaterAbout static const std::string sCheckUpdateListenerName; static void startFetchServerReleaseNotes(); - static void fetchServerReleaseNotesCoro(const std::string& cap_url); + static void fetchServerReleaseNotesCoro(const std::string cap_url); static void handleServerReleaseNotes(LLSD results); }; @@ -227,7 +227,7 @@ void LLFloaterAbout::startFetchServerReleaseNotes() } /*static*/ -void LLFloaterAbout::fetchServerReleaseNotesCoro(const std::string& cap_url) +void LLFloaterAbout::fetchServerReleaseNotesCoro(const std::string cap_url) { LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("fetchServerReleaseNotesCoro", LLCore::HttpRequest::DEFAULT_POLICY_ID)); diff --git a/indra/newview/llviewerdisplayname.cpp b/indra/newview/llviewerdisplayname.cpp index d444d476242..a27f7c65b80 100644 --- a/indra/newview/llviewerdisplayname.cpp +++ b/indra/newview/llviewerdisplayname.cpp @@ -98,7 +98,7 @@ void LLViewerDisplayName::set(const std::string& display_name, const set_name_sl boost::bind(&LLViewerDisplayName::setDisplayNameCoro, cap_url, body)); } -void LLViewerDisplayName::setDisplayNameCoro(const std::string& cap_url, const LLSD& body) +void LLViewerDisplayName::setDisplayNameCoro(const std::string cap_url, const LLSD body) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t diff --git a/indra/newview/llviewerdisplayname.h b/indra/newview/llviewerdisplayname.h index 337aaa68b60..7668cd12ef6 100644 --- a/indra/newview/llviewerdisplayname.h +++ b/indra/newview/llviewerdisplayname.h @@ -47,7 +47,7 @@ namespace LLViewerDisplayName // unavailable or name not available. void set(const std::string& display_name, const set_name_slot_t& slot); - void setDisplayNameCoro(const std::string& cap_url, const LLSD& body); + void setDisplayNameCoro(const std::string cap_url, const LLSD body); void addNameChangedCallback(const name_changed_signal_t::slot_type& cb); } diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index a4eaf4a0c23..dc7f31e451b 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -302,7 +302,7 @@ void RlvHandler::removeBlockedObject(const LLUUID& idObj) }), m_BlockedObjects.end()); } -void RlvHandler::getAttachmentResourcesCoro(const std::string& strUrl) +void RlvHandler::getAttachmentResourcesCoro(const std::string strUrl) { LLCore::HttpRequest::policy_t httpPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID); LLCoreHttpUtil::HttpCoroutineAdapter::ptr_t httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("RlvHandler::getAttachmentResourcesCoro", httpPolicy)); diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index 85acec1bceb..eba2c328830 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -185,7 +185,7 @@ class RlvHandler : public LLOldEvents::LLSimpleListener, public LLParticularGrou void onTeleportFinished(const LLVector3d& posArrival); static void onIdleStartup(void* pParam); protected: - void getAttachmentResourcesCoro(const std::string& strUrl); + void getAttachmentResourcesCoro(const std::string strUrl); void onTeleportCallback(U64 hRegion, const LLVector3& posRegion, const LLVector3& vecLookAt, const LLUUID& idRlvObj); /* -- GitLab