summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerregion.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2020-09-28 22:33:51 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2020-09-28 22:33:51 +0300
commit4e43097c77a5efc1353eec13cdcb0f2c3e3bca92 (patch)
tree5417b02fd09c31c52c79d5e52e5323364673bf91 /indra/newview/llviewerregion.cpp
parent54beabc63665b3b431e901f36ea695712ca7e6bb (diff)
parentbac6652cdcd2d8333df04c3ebd3a6a7b752328b3 (diff)
Merge branch 'master' into DRTVWR-518-ui
# Conflicts: # indra/newview/llfloaterbuycurrency.cpp # indra/newview/llinventorybridge.cpp # indra/newview/llinventorypanel.h # indra/newview/skins/default/xui/en/floater_buy_currency.xml
Diffstat (limited to 'indra/newview/llviewerregion.cpp')
-rw-r--r--indra/newview/llviewerregion.cpp45
1 files changed, 42 insertions, 3 deletions
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index e67826454b..a30c5156fa 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -102,6 +102,7 @@ const U32 DEFAULT_MAX_REGION_WIDE_PRIM_COUNT = 15000;
BOOL LLViewerRegion::sVOCacheCullingEnabled = FALSE;
S32 LLViewerRegion::sLastCameraUpdated = 0;
S32 LLViewerRegion::sNewObjectCreationThrottle = -1;
+LLViewerRegion::vocache_entry_map_t LLViewerRegion::sRegionCacheCleanup;
typedef std::map<std::string, std::string> CapabilityMap;
@@ -298,6 +299,11 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
++mSeedCapAttempts;
+ if (LLApp::isExiting())
+ {
+ return;
+ }
+
regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
@@ -412,6 +418,11 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle)
break; // no retry
}
+ if (LLApp::isExiting())
+ {
+ break;
+ }
+
regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
@@ -515,6 +526,11 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region
continue;
}
+ if (LLApp::isExiting())
+ {
+ break;
+ }
+
// remove the http_result from the llsd
result.erase("http_result");
@@ -609,6 +625,8 @@ LLViewerRegion::LLViewerRegion(const U64 &handle,
mImpl->mObjectPartition.push_back(new LLGrassPartition(this)); //PARTITION_GRASS
mImpl->mObjectPartition.push_back(new LLVolumePartition(this)); //PARTITION_VOLUME
mImpl->mObjectPartition.push_back(new LLBridgePartition(this)); //PARTITION_BRIDGE
+ mImpl->mObjectPartition.push_back(new LLAvatarPartition(this)); //PARTITION_AVATAR
+ mImpl->mObjectPartition.push_back(new LLControlAVPartition(this)); //PARTITION_CONTROL_AV
mImpl->mObjectPartition.push_back(new LLHUDParticlePartition(this));//PARTITION_HUD_PARTICLE
mImpl->mObjectPartition.push_back(new LLVOCachePartition(this)); //PARTITION_VO_CACHE
mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE
@@ -633,6 +651,9 @@ void LLViewerRegion::initStats()
mAlive = false; // can become false if circuit disconnects
}
+static LLTrace::BlockTimerStatHandle FTM_CLEANUP_REGION_OBJECTS("Cleanup Region Objects");
+static LLTrace::BlockTimerStatHandle FTM_SAVE_REGION_CACHE("Save Region Cache");
+
LLViewerRegion::~LLViewerRegion()
{
mDead = TRUE;
@@ -647,7 +668,10 @@ LLViewerRegion::~LLViewerRegion()
disconnectAllNeighbors();
LLViewerPartSim::getInstance()->cleanupRegion(this);
- gObjectList.killObjects(this);
+ {
+ LL_RECORD_BLOCK_TIME(FTM_CLEANUP_REGION_OBJECTS);
+ gObjectList.killObjects(this);
+ }
delete mImpl->mCompositionp;
delete mParcelOverlay;
@@ -658,7 +682,10 @@ LLViewerRegion::~LLViewerRegion()
#endif
std::for_each(mImpl->mObjectPartition.begin(), mImpl->mObjectPartition.end(), DeletePointer());
- saveObjectCache();
+ {
+ LL_RECORD_BLOCK_TIME(FTM_SAVE_REGION_CACHE);
+ saveObjectCache();
+ }
delete mImpl;
mImpl = NULL;
@@ -727,6 +754,8 @@ void LLViewerRegion::saveObjectCache()
mCacheDirty = FALSE;
}
+ // Map of LLVOCacheEntry takes time to release, store map for cleanup on idle
+ sRegionCacheCleanup.insert(mImpl->mCacheMap.begin(), mImpl->mCacheMap.end());
mImpl->mCacheMap.clear();
}
@@ -1488,6 +1517,16 @@ void LLViewerRegion::idleUpdate(F32 max_update_time)
return;
}
+// static
+void LLViewerRegion::idleCleanup(F32 max_update_time)
+{
+ LLTimer update_timer;
+ while (!sRegionCacheCleanup.empty() && (max_update_time - update_timer.getElapsedTimeF32() > 0))
+ {
+ sRegionCacheCleanup.erase(sRegionCacheCleanup.begin());
+ }
+}
+
//update the throttling number for new object creation
void LLViewerRegion::calcNewObjectCreationThrottle()
{
@@ -3144,7 +3183,7 @@ void LLViewerRegion::setCapabilitiesReceived(bool received)
{
mCapabilitiesReceivedSignal(getRegionID());
- //LLFloaterPermsDefault::sendInitialPerms();
+ LLFloaterPermsDefault::sendInitialPerms();
// This is a single-shot signal. Forget callbacks to save resources.
mCapabilitiesReceivedSignal.disconnect_all_slots();