diff options
author | Oz Linden <oz@lindenlab.com> | 2020-06-15 15:29:04 -0400 |
---|---|---|
committer | Oz Linden <oz@lindenlab.com> | 2020-06-15 15:29:04 -0400 |
commit | 86009f885efc796850d3e5b612c896a9d737fb86 (patch) | |
tree | 404923800dbc6d09ea72b10de0c7f4bb103d1e62 /indra/newview/llappviewer.cpp | |
parent | 17598f936bb6b099f21fc32aa80b68258cdfd0b9 (diff) | |
parent | 1702a65665879d0c68df4c6b4fdb60f815ab7abb (diff) |
SL-10297: merge up to master at 6.4.3
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 95 |
1 files changed, 65 insertions, 30 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 8009a9c117..ff3d86751d 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -33,6 +33,7 @@ #include "llfeaturemanager.h" #include "lluictrlfactory.h" #include "lltexteditor.h" +#include "llenvironment.h" #include "llerrorcontrol.h" #include "lleventtimer.h" #include "llviewertexturelist.h" @@ -61,13 +62,16 @@ #include "llallocator.h" #include "llcalc.h" #include "llconversationlog.h" +#if LL_WINDOWS #include "lldxhardware.h" +#endif #include "lltexturestats.h" #include "lltrace.h" #include "lltracethreadrecorder.h" #include "llviewerwindow.h" #include "llviewerdisplay.h" #include "llviewermedia.h" +#include "llviewerparcelaskplay.h" #include "llviewerparcelmedia.h" #include "llviewermediafocus.h" #include "llviewermessage.h" @@ -171,8 +175,6 @@ #include "llviewerparcelmgr.h" #include "llworldmapview.h" #include "llpostprocess.h" -#include "llwlparammanager.h" -#include "llwaterparammanager.h" #include "lldebugview.h" #include "llconsole.h" @@ -208,6 +210,7 @@ #include "llfloateroutfitsnapshot.h" #include "llfloatersnapshot.h" #include "llsidepanelinventory.h" +#include "llatmosphere.h" // includes for idle() idleShutdown() #include "llviewercontrol.h" @@ -670,7 +673,8 @@ LLAppViewer::LLAppViewer() mReportedCrash(false), mNumSessions(0), mPurgeCache(false), - mPurgeOnExit(false), + mPurgeCacheOnExit(false), + mPurgeUserDataOnExit(false), mSecondInstance(false), mSavedFinalSnapshot(false), mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded. @@ -765,6 +769,10 @@ bool LLAppViewer::init() // Memory will be cleaned up in ::cleanupClass() LLWearableType::initParamSingleton(new LLUITranslationBridge()); + // initialize the LLSettingsType translation bridge. + LLTranslationBridge::ptr_t trans = std::make_shared<LLUITranslationBridge>(); + LLSettingsType::initClass(trans); + // initialize SSE options LLVector4a::initClass(); @@ -1108,13 +1116,16 @@ bool LLAppViewer::init() try { initializeSecHandler(); } - catch (LLProtectedDataException ex) + catch (LLProtectedDataException&) { LLNotificationsUtil::add("CorruptedProtectedDataStore"); } gGLActive = FALSE; +#if LL_RELEASE_FOR_DOWNLOAD + if (!gSavedSettings.getBOOL("CmdLineSkipUpdater")) + { LLProcess::Params updater; updater.desc = "updater process"; // Because it's the updater, it MUST persist beyond the lifespan of the @@ -1140,18 +1151,13 @@ bool LLAppViewer::init() // ForceAddressSize updater.args.add(stringize(gSavedSettings.getU32("ForceAddressSize"))); -#if LL_WINDOWS && !LL_RELEASE_FOR_DOWNLOAD && !LL_SEND_CRASH_REPORTS - // This is neither a release package, nor crash-reporting enabled test build - // try to run version updater, but don't bother if it fails (file might be missing) - LLLeap *leap_p = LLLeap::create(updater, false); - if (!leap_p) + // Run the updater. An exception from launching the updater should bother us. + LLLeap::create(updater, true); + } + else { - LL_WARNS("LLLeap") << "Failed to run LLLeap" << LL_ENDL; + LL_WARNS("InitInfo") << "Skipping updater check." << LL_ENDL; } -#else - // Run the updater. An exception from launching the updater should bother us. - LLLeap::create(updater, true); -#endif // Iterate over --leap command-line options. But this is a bit tricky: if // there's only one, it won't be an array at all. @@ -1183,6 +1189,7 @@ bool LLAppViewer::init() << "lleventhost no longer supported as a dynamic library" << LL_ENDL; } +#endif LLTextUtil::TextHelpers::iconCallbackCreationFunction = create_text_segment_icon_from_url_match; @@ -1294,6 +1301,8 @@ static LLTrace::BlockTimerStatHandle FTM_YIELD("Yield"); static LLTrace::BlockTimerStatHandle FTM_TEXTURE_CACHE("Texture Cache"); static LLTrace::BlockTimerStatHandle FTM_DECODE("Image Decode"); +static LLTrace::BlockTimerStatHandle FTM_FETCH("Image Fetch"); + static LLTrace::BlockTimerStatHandle FTM_VFS("VFS Thread"); static LLTrace::BlockTimerStatHandle FTM_LFS("LFS Thread"); static LLTrace::BlockTimerStatHandle FTM_PAUSE_THREADS("Pause Threads"); @@ -1321,7 +1330,7 @@ bool LLAppViewer::frame() { LOG_UNHANDLED_EXCEPTION(""); } - catch (std::bad_alloc) + catch (std::bad_alloc&) { LLMemory::logMemoryInfo(TRUE); LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance<LLFloaterMemLeak>("mem_leaking"); @@ -1445,8 +1454,10 @@ bool LLAppViewer::doFrame() pingMainloopTimeout("Main:Display"); gGLActive = TRUE; + display(); + static U64 last_call = 0; - if (!gTeleportDisplay) + if (!gTeleportDisplay || gGLManager.mIsIntel) // SL-10625...throttle early, throttle often with Intel { // Frame/draw throttling U64 elapsed_time = LLTimer::getTotalTime() - last_call; @@ -1460,8 +1471,6 @@ bool LLAppViewer::doFrame() } last_call = LLTimer::getTotalTime(); - display(); - pingMainloopTimeout("Main:Snapshot"); LLFloaterSnapshot::update(); // take snapshots LLFloaterOutfitSnapshot::update(); @@ -1608,7 +1617,7 @@ S32 LLAppViewer::updateTextureThreads(F32 max_time) work_pending += LLAppViewer::getImageDecodeThread()->update(max_time); // unpauses the image thread } { - LL_RECORD_BLOCK_TIME(FTM_DECODE); + LL_RECORD_BLOCK_TIME(FTM_FETCH); work_pending += LLAppViewer::getTextureFetch()->update(max_time); // unpauses the texture fetch thread } return work_pending; @@ -1631,6 +1640,8 @@ void LLAppViewer::flushVFSIO() bool LLAppViewer::cleanup() { + LLAtmosphere::cleanupClass(); + //ditch LLVOAvatarSelf instance gAgentAvatarp = NULL; @@ -1688,6 +1699,11 @@ bool LLAppViewer::cleanup() disconnectViewer(); LL_INFOS() << "Viewer disconnected" << LL_ENDL; + + if (gKeyboard) + { + gKeyboard->resetKeys(); + } display_cleanup(); @@ -1880,6 +1896,12 @@ bool LLAppViewer::cleanup() // Store the time of our current logoff gSavedPerAccountSettings.setU32("LastLogoff", time_corrected()); + if (LLEnvironment::instanceExists()) + { + //Store environment settings if nessesary + LLEnvironment::getInstance()->saveToSettings(); + } + // Must do this after all panels have been deleted because panels that have persistent rects // save their rects on delete. gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); @@ -1903,6 +1925,11 @@ bool LLAppViewer::cleanup() { gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); LL_INFOS() << "Saved settings" << LL_ENDL; + + if (LLViewerParcelAskPlay::instanceExists()) + { + LLViewerParcelAskPlay::getInstance()->saveSettings(); + } } std::string warnings_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, getSettingsFilename("Default", "Warnings")); @@ -1923,7 +1950,7 @@ bool LLAppViewer::cleanup() LLConversationLog::instance().cache(); } - if (mPurgeOnExit) + if (mPurgeCacheOnExit) { LL_INFOS() << "Purging all cache files on exit" << LL_ENDL; gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""), "*.*"); @@ -1964,6 +1991,14 @@ bool LLAppViewer::cleanup() } } + if (mPurgeUserDataOnExit) + { + // Ideally we should not save anything from this session since it is going to be purged now, + // but this is a very 'rare' case (user deleting himself), not worth overcomplicating 'save&cleanup' code + std::string user_path = gDirUtilp->getOSUserAppDir() + gDirUtilp->getDirDelimiter() + LLStartUp::getUserId(); + gDirUtilp->deleteDirAndContents(user_path); + } + // Delete workers first // shotdown all worker threads before deleting them in case of co-dependencies mAppCoreHttp.requestStop(); @@ -2149,13 +2184,11 @@ LLError::ErrFatalHookResult fatalErrorHook(const std::string &error_string) // static info file. LLAppViewer::instance()->writeDebugInfo(); - if (sQAModeTermCode) - { - _exit(sQAModeTermCode); - return LLError::ERR_DO_NOT_CRASH; // notreached - } - +#ifdef SHADER_CRASH_NONFATAL + return LLError::ERR_DO_NOT_CRASH; +#else return LLError::ERR_CRASH; +#endif } void LLAppViewer::initLoggingAndGetLastDuration() @@ -3945,7 +3978,10 @@ static LLNotificationFunctorRegistration finish_quit_reg("ConfirmQuit", finish_q void LLAppViewer::userQuit() { - if (gDisconnected || gViewerWindow->getProgressView()->getVisible()) + if (gDisconnected + || !gViewerWindow + || !gViewerWindow->getProgressView() + || gViewerWindow->getProgressView()->getVisible()) { requestQuit(); } @@ -4435,7 +4471,7 @@ void LLAppViewer::badNetworkHandler() // Flush all of our caches on exit in the case of disconnect due to // invalid packets. - mPurgeOnExit = TRUE; + mPurgeCacheOnExit = TRUE; std::ostringstream message; message << @@ -4898,7 +4934,6 @@ void LLAppViewer::idle() // // Update weather effects // - gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets // Update wind vector LLVector3 wind_position_region; @@ -5382,7 +5417,7 @@ bool LLAppViewer::onChangeFrameLimit(LLSD const & evt) { if (evt.asInteger() > 0) { - mMinMicroSecPerFrame = 1000000 / evt.asInteger(); + mMinMicroSecPerFrame = (U64)(1000000.0f / F32(evt.asInteger())); } else { |