summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-08-06 16:40:00 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-08-06 16:40:00 +0300
commit2795fe9786c96b057dee4ce6f4fd1504117e6f78 (patch)
treeb88e8b0ae7f62a51bd0df0894a61d1fb97f8235b /indra/newview/llappviewer.cpp
parentfd15b4309b126fd5f83f2091c060a6043e18fdbf (diff)
parent75455d101c9535d0d45aa0f505f888f4ba3de64d (diff)
Merge branch 'develop' into marchcat/b-sync
# Conflicts: # .github/workflows/build.yaml # autobuild.xml # indra/cmake/Audio.cmake # indra/cmake/Copy3rdPartyLibs.cmake # indra/llxml/llxmltree.cpp # indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp42
1 files changed, 37 insertions, 5 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 4ff73e1fc9..25b9960225 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -642,6 +642,7 @@ LLAppViewer::LLAppViewer()
mSavedFinalSnapshot(false),
mSavePerAccountSettings(false), // don't save settings on logout unless login succeeded.
mQuitRequested(false),
+ mClosingFloaters(false),
mLogoutRequestSent(false),
mLastAgentControlFlags(0),
mLastAgentForceUpdate(0),
@@ -797,7 +798,7 @@ bool LLAppViewer::init()
settings_map["floater"] = &gSavedSettings; // *TODO: New settings file
settings_map["account"] = &gSavedPerAccountSettings;
- LLUI::initParamSingleton(settings_map,
+ LLUI::createInstance(settings_map,
LLUIImageList::getInstance(),
ui_audio_callback,
deferred_ui_audio_callback);
@@ -2150,6 +2151,7 @@ bool LLAppViewer::cleanup()
LLViewerEventRecorder::deleteSingleton();
LLWorld::deleteSingleton();
LLVoiceClient::deleteSingleton();
+ LLUI::deleteSingleton();
// It's not at first obvious where, in this long sequence, a generic cleanup
// call OUGHT to go. So let's say this: as we migrate cleanup from
@@ -2244,7 +2246,9 @@ void errorCallback(LLError::ELevel level, const std::string &error_string)
if (level == LLError::LEVEL_ERROR)
{
#ifndef LL_RELEASE_FOR_DOWNLOAD
- OSMessageBox(error_string, LLTrans::getString("MBFatalError"), OSMB_OK);
+ std::string message = error_string +
+ "\n\n\nThis is a developer-only notification!\nThis notification won't be present in Release for download build";
+ OSMessageBox(message, LLTrans::getString("MBFatalError"), OSMB_OK);
#endif
gDebugInfo["FatalMessage"] = error_string;
@@ -4032,6 +4036,7 @@ void LLAppViewer::requestQuit()
{
// application is quitting
gFloaterView->closeAllChildren(true);
+ mClosingFloaters = true;
}
// Send preferences once, when exiting
@@ -4095,6 +4100,7 @@ void LLAppViewer::abortQuit()
{
LL_INFOS() << "abortQuit()" << LL_ENDL;
mQuitRequested = false;
+ mClosingFloaters = false;
}
void LLAppViewer::migrateCacheDirectory()
@@ -5044,10 +5050,19 @@ void LLAppViewer::idleShutdown()
}
// Wait for all floaters to get resolved
- if (gFloaterView
- && !gFloaterView->allChildrenClosed())
+ if (gFloaterView)
{
- return;
+ if (!mClosingFloaters)
+ {
+ // application is quitting
+ gFloaterView->closeAllChildren(true);
+ mClosingFloaters = true;
+ return;
+ }
+ if (!gFloaterView->allChildrenClosed())
+ {
+ return;
+ }
}
// ProductEngine: Try moving this code to where we shut down sTextureCache in cleanup()
@@ -5208,6 +5223,23 @@ void LLAppViewer::postToMainCoro(const LL::WorkQueue::Work& work)
gMainloopWork.post(work);
}
+void LLAppViewer::outOfMemorySoftQuit()
+{
+ if (!mQuitRequested)
+ {
+ // Todo:
+ // Find a way to free at least some memory to make it safer
+ // Pause decoding and mesh repositorie
+ getTextureCache()->pause();
+ getTextureFetch()->pause();
+ LLLFSThread::sLocal->pause();
+ gLogoutTimer.reset();
+ mQuitRequested = true;
+
+ LLError::LLUserWarningMsg::showOutOfMemory();
+ }
+}
+
void LLAppViewer::idleNameCache()
{
// Neither old nor new name cache can function before agent has a region