summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2022-05-27 02:53:34 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2022-05-27 02:53:34 +0300
commitb2ef95522f07301cfddbdace1042e60d52fde436 (patch)
treec51119f79b734a7d503bb3adeac1759b819c8f92 /indra/newview/llviewerregion.cpp
parent43a338c6270f9a000052465d09d4ad999524af0b (diff)
parent3da7a50b71d4ef5919c2d4d5b9547b3ef0abab7d (diff)
Merge branch 'DRTVWR-543-maint' into DRTVWR-543-maint_cmake
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rw-r--r--indra/newview/llviewerregion.cpp66
1 files changed, 59 insertions, 7 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index f59d53623b..b282a2b90c 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -266,7 +266,14 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
return;
}
- regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ LLWorld *world_inst = LLWorld::getInstance(); // Not a singleton!
+ if (!world_inst)
+ {
+ LL_WARNS("AppInit", "Capabilities") << "Attempting to get capabilities, but world no longer exists!" << LL_ENDL;
+ return;
+ }
+
+ regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
LL_WARNS("AppInit", "Capabilities") << "Attempting to get capabilities for region that no longer exists!" << LL_ENDL;
@@ -314,6 +321,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
regionp = NULL;
impl = NULL;
+ world_inst = NULL;
result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames);
if (STATE_WORLD_INIT > LLStartUp::getStartupState())
@@ -327,7 +335,14 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
return;
}
- regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ world_inst = LLWorld::getInstance();
+ if (!world_inst)
+ {
+ LL_WARNS("AppInit", "Capabilities") << "Received capabilities, but world no longer exists!" << LL_ENDL;
+ return;
+ }
+
+ regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
LL_WARNS("AppInit", "Capabilities") << "Received capabilities for region that no longer exists!" << LL_ENDL;
@@ -411,7 +426,14 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle)
// This loop is used for retrying a capabilities request.
do
{
- regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ LLWorld *world_inst = LLWorld::getInstance(); // Not a singleton!
+ if (!world_inst)
+ {
+ LL_WARNS("AppInit", "Capabilities") << "Attempting to get capabilities, but world no longer exists!" << LL_ENDL;
+ return;
+ }
+
+ regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
LL_WARNS("AppInit", "Capabilities") << "Attempting to get capabilities for region that no longer exists!" << LL_ENDL;
@@ -434,6 +456,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle)
LL_INFOS("AppInit", "Capabilities") << "Requesting second Seed from " << url << " for region " << regionp->getRegionID() << LL_ENDL;
regionp = NULL;
+ world_inst = NULL;
result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames);
LLSD httpResults = result["http_result"];
@@ -449,7 +472,14 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle)
break;
}
- regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ world_inst = LLWorld::getInstance();
+ if (!world_inst)
+ {
+ LL_WARNS("AppInit", "Capabilities") << "Received capabilities, but world no longer exists!" << LL_ENDL;
+ return;
+ }
+
+ regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
LL_WARNS("AppInit", "Capabilities") << "Received capabilities for region that no longer exists!" << LL_ENDL;
@@ -533,7 +563,14 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region
break;
}
- regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ LLWorld *world_inst = LLWorld::getInstance(); // Not a singleton!
+ if (!world_inst)
+ {
+ LL_WARNS("AppInit", "Capabilities") << "Attempting to request Sim Feature, but world no longer exists!" << LL_ENDL;
+ return;
+ }
+
+ regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
LL_WARNS("AppInit", "SimulatorFeatures") << "Attempting to request Sim Feature for region that no longer exists!" << LL_ENDL;
@@ -541,6 +578,7 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region
}
regionp = NULL;
+ world_inst = NULL;
LLSD result = httpAdapter->getAndSuspend(httpRequest, url);
LLSD httpResults = result["http_result"];
@@ -559,7 +597,14 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region
// remove the http_result from the llsd
result.erase("http_result");
- regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
+ world_inst = LLWorld::getInstance();
+ if (!world_inst)
+ {
+ LL_WARNS("AppInit", "Capabilities") << "Attempting to request Sim Feature, but world no longer exists!" << LL_ENDL;
+ return;
+ }
+
+ regionp = world_inst->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
LL_WARNS("AppInit", "SimulatorFeatures") << "Attempting to set Sim Feature for region that no longer exists!" << LL_ENDL;
@@ -2092,7 +2137,14 @@ public:
const LLSD& input) const
{
LLHost host(input["sender"].asString());
- LLViewerRegion* region = LLWorld::getInstance()->getRegion(host);
+
+ LLWorld *world_inst = LLWorld::getInstance(); // Not a singleton!
+ if (!world_inst)
+ {
+ return;
+ }
+
+ LLViewerRegion* region = world_inst->getRegion(host);
if( !region )
{
return;