summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-07-29 11:00:05 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-07-29 21:20:38 +0300
commitc5d2e92089344b115d657eb23487144cb3d9842a (patch)
tree7b60d24dd3613f92c1d6ce022c080816d9e29aa4 /indra/newview/llappviewer.cpp
parentc4ff0b48898de86b9ee8e198395e16a8429c8aa4 (diff)
viewer#2071 Soft quit on 'out of memory' for meshes #2
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp35
1 files changed, 32 insertions, 3 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b380b09129..d25762f561 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -646,6 +646,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),
@@ -4028,6 +4029,7 @@ void LLAppViewer::requestQuit()
{
// application is quitting
gFloaterView->closeAllChildren(true);
+ mClosingFloaters = true;
}
// Send preferences once, when exiting
@@ -4091,6 +4093,7 @@ void LLAppViewer::abortQuit()
{
LL_INFOS() << "abortQuit()" << LL_ENDL;
mQuitRequested = false;
+ mClosingFloaters = false;
}
void LLAppViewer::migrateCacheDirectory()
@@ -5040,10 +5043,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()
@@ -5204,6 +5216,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