summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorEuclid Linden <euclid@lindenlab.com>2022-05-27 21:15:49 +0000
committerEuclid Linden <euclid@lindenlab.com>2022-05-27 21:15:49 +0000
commit3f98411c56f4daa06c9102346a8dd37af18d2cb6 (patch)
tree4255c2827cc3e07921275bfd7937f4f43f29d5fa /indra/newview/llviewerregion.cpp
parent3f58ec2fdfb76ce2160884a3e97be49f60b6ac90 (diff)
parent02c71b0ac2f99dd1c26a649ffce2182b2fc9a7d9 (diff)
Merged in DV528-merge-6.6.1 (pull request #1000)
DRTVWR-528 merge up to 6.6.1
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 2fb760ed17..67ad72e997 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;