summaryrefslogtreecommitdiff
path: root/indra/newview/llavatarrenderinfoaccountant.cpp
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2022-04-26 16:03:03 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2022-04-26 16:03:03 +0300
commit79c9a8a4b79124baa06cb6630be3113906f1e342 (patch)
tree84e73c23280a42f5fff630a05e23cf914ae289bf /indra/newview/llavatarrenderinfoaccountant.cpp
parente5e710a1e6e0f74cd60647e3dae7d037076351ff (diff)
parentbafa869c21cb8b329f94be6fa930a43d11699082 (diff)
Merge branch 'DRTVWR-546' into DRTVWR-539
Diffstat (limited to 'indra/newview/llavatarrenderinfoaccountant.cpp')
-rw-r--r--indra/newview/llavatarrenderinfoaccountant.cpp33
1 files changed, 30 insertions, 3 deletions
diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp
index ca83afb5ab..fe94cd27b6 100644
--- a/indra/newview/llavatarrenderinfoaccountant.cpp
+++ b/indra/newview/llavatarrenderinfoaccountant.cpp
@@ -82,7 +82,15 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoGetCoro(std::string url, U64
LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
- LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ LLWorld *world_inst = LLWorld::getInstance();
+ if (!world_inst)
+ {
+ LL_WARNS("AvatarRenderInfoAccountant") << "Avatar render weight info received but world no longer exists "
+ << regionHandle << LL_ENDL;
+ return;
+ }
+
+ LLViewerRegion * regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp)
{
LL_WARNS("AvatarRenderInfoAccountant") << "Avatar render weight info received but region not found for "
@@ -183,7 +191,15 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U
httpAdapter(new LLCoreHttpUtil::HttpCoroutineAdapter("AvatarRenderInfoAccountant", httpPolicy));
LLCore::HttpRequest::ptr_t httpRequest(new LLCore::HttpRequest);
- LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ LLWorld *world_inst = LLWorld::getInstance();
+ if (!world_inst)
+ {
+ LL_WARNS("AvatarRenderInfoAccountant") << "Avatar render weight calculation but world no longer exists "
+ << regionHandle << LL_ENDL;
+ return;
+ }
+
+ LLViewerRegion * regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp)
{
LL_WARNS("AvatarRenderInfoAccountant") << "Avatar render weight calculation but region not found for "
@@ -239,9 +255,18 @@ void LLAvatarRenderInfoAccountant::avatarRenderInfoReportCoro(std::string url, U
report[KEY_AGENTS] = agents;
regionp = NULL;
+ world_inst = NULL;
LLSD result = httpAdapter->postAndSuspend(httpRequest, url, report);
- regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ world_inst = LLWorld::getInstance();
+ if (!world_inst)
+ {
+ LL_WARNS("AvatarRenderInfoAccountant") << "Avatar render weight POST result but world no longer exists "
+ << regionHandle << LL_ENDL;
+ return;
+ }
+
+ regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp)
{
LL_INFOS("AvatarRenderInfoAccountant") << "Avatar render weight POST result received but region not found for "
@@ -345,6 +370,8 @@ void LLAvatarRenderInfoAccountant::idle()
&& regionp->capabilitiesReceived())
{
// each of these is further governed by and resets its own timer
+ // Note: We can have multiple regions, each launches up to two coroutines,
+ // it likely is expensive
sendRenderInfoToRegion(regionp);
getRenderInfoFromRegion(regionp);
}