summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp61
1 files changed, 39 insertions, 22 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 72bfdcf83c..b8aac829fe 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -3145,7 +3145,7 @@ bool LLAppViewer::initWindow()
// Need to load feature table before cheking to start watchdog.
bool use_watchdog = false;
- int watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled");
+ S32 watchdog_enabled_setting = gSavedSettings.getS32("WatchdogEnabled");
if (watchdog_enabled_setting == -1)
{
use_watchdog = !LLFeatureManager::getInstance()->isFeatureAvailable("WatchdogDisabled");
@@ -3950,7 +3950,7 @@ void LLAppViewer::processMarkerFiles()
#if LL_WINDOWS && LL_BUGSPLAT
// bugsplat will set correct state in bugsplatSendLog
// Might be more accurate to rename this one into 'unknown'
- gLastExecEvent = LAST_EXEC_FROZE;
+ gLastExecEvent = LAST_EXEC_UNKNOWN;
#else
gLastExecEvent = LAST_EXEC_OTHER_CRASH;
#endif // LL_WINDOWS
@@ -3996,7 +3996,8 @@ void LLAppViewer::processMarkerFiles()
{
if (markerIsSameVersion(logout_marker_file))
{
- gLastExecEvent = LAST_EXEC_LOGOUT_FROZE;
+ // Either froze, got killed or somehow crash was not caught
+ gLastExecEvent = LAST_EXEC_LOGOUT_UNKNOWN;
LL_INFOS("MarkerFile") << "Logout crash marker '"<< logout_marker_file << "', changing LastExecEvent to LOGOUT_FROZE" << LL_ENDL;
}
else
@@ -4509,7 +4510,19 @@ void LLAppViewer::purgeCacheImmediate()
{
LL_INFOS("AppCache") << "Purging Object Cache and Texture Cache immediately..." << LL_ENDL;
LLAppViewer::getTextureCache()->purgeCache(LL_PATH_CACHE, false);
- LLVOCache::getInstance()->removeCache(LL_PATH_CACHE, true);
+ if (LLVOCache::instanceExists())
+ {
+ LLVOCache::getInstance()->removeCache(LL_PATH_CACHE, true);
+ }
+ else if (!mSecondInstance)
+ {
+ // LLVOCache requires parameters to be initialized, if it's not there, try manually
+ std::string mask = "*";
+ std::string cache_dir = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "objectcache");
+ LL_INFOS() << "Removing cache at " << cache_dir << LL_ENDL;
+ gDirUtilp->deleteFilesInDir(cache_dir, mask); //delete all files
+ LLFile::rmdir(cache_dir);
+ }
}
std::string LLAppViewer::getSecondLifeTitle() const
@@ -5820,12 +5833,12 @@ void LLAppViewer::forceExceptionThreadCrash()
thread->start();
}
-void LLAppViewer::initMainloopTimeout(std::string_view state, F32 secs)
+void LLAppViewer::initMainloopTimeout(std::string_view state)
{
if (!mMainloopTimeout)
{
mMainloopTimeout = new LLWatchdogTimeout();
- resumeMainloopTimeout(state, secs);
+ resumeMainloopTimeout(state);
}
}
@@ -5838,17 +5851,11 @@ void LLAppViewer::destroyMainloopTimeout()
}
}
-void LLAppViewer::resumeMainloopTimeout(std::string_view state, F32 secs)
+void LLAppViewer::resumeMainloopTimeout(std::string_view state)
{
if (mMainloopTimeout)
{
- if (secs < 0.0f)
- {
- static LLCachedControl<F32> mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60.f);
- secs = mainloop_timeout;
- }
-
- mMainloopTimeout->setTimeout(secs);
+ mMainloopTimeout->setTimeout(getMainloopTimeoutSec());
mMainloopTimeout->start(state);
}
}
@@ -5861,23 +5868,33 @@ void LLAppViewer::pauseMainloopTimeout()
}
}
-void LLAppViewer::pingMainloopTimeout(std::string_view state, F32 secs)
+void LLAppViewer::pingMainloopTimeout(std::string_view state)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_APP;
if (mMainloopTimeout)
{
- if (secs < 0.0f)
- {
- static LLCachedControl<F32> mainloop_timeout(gSavedSettings, "MainloopTimeoutDefault", 60);
- secs = mainloop_timeout;
- }
-
- mMainloopTimeout->setTimeout(secs);
+ mMainloopTimeout->setTimeout(getMainloopTimeoutSec());
mMainloopTimeout->ping(state);
}
}
+
+F32 LLAppViewer::getMainloopTimeoutSec() const
+{
+ if (LLStartUp::getStartupState() == STATE_STARTED
+ && gAgent.getTeleportState() == LLAgent::TELEPORT_NONE)
+ {
+ static LLCachedControl<F32> mainloop_started(gSavedSettings, "MainloopTimeoutStarted", 30.f);
+ return mainloop_started();
+ }
+ else
+ {
+ static LLCachedControl<F32> mainloop_default(gSavedSettings, "MainloopTimeoutDefault", 120.f);
+ return mainloop_default();
+ }
+}
+
void LLAppViewer::handleLoginComplete()
{
gLoggedInTime.start();