summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
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 7995bf261a..469cba78fb 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -262,7 +262,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;
@@ -304,6 +311,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())
@@ -317,7 +325,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;
@@ -396,7 +411,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;
@@ -424,6 +446,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"];
@@ -439,7 +462,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;
@@ -523,7 +553,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;
@@ -531,6 +568,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"];
@@ -549,7 +587,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;
@@ -2074,7 +2119,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;