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.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index ab4a0fbc28..0b882a2265 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -109,6 +109,7 @@
#include "lllocalbitmaps.h"
#include "llperfstats.h"
#include "llgltfmateriallist.h"
+#include "llwebsocketmgr.h"
// Linden library includes
#include "llavatarnamecache.h"
@@ -1350,8 +1351,7 @@ bool LLAppViewer::frame()
bool LLAppViewer::doFrame()
{
- LL_RECORD_BLOCK_TIME(FTM_FRAME);
- LL_PROFILE_GPU_ZONE("Frame");
+ resumeMainloopTimeout("Main:doFrameStart");
#ifdef LL_DISCORD
{
LL_PROFILE_ZONE_NAMED("discord_callbacks");
@@ -1644,17 +1644,20 @@ bool LLAppViewer::doFrame()
if (LLApp::isExiting())
{
+ pingMainloopTimeout("Main:qSnapshot");
// Save snapshot for next time, if we made it through initialization
if (STATE_STARTED == LLStartUp::getStartupState())
{
saveFinalSnapshot();
}
+ pingMainloopTimeout("Main:TerminateVoice");
if (LLVoiceClient::instanceExists())
{
LLVoiceClient::getInstance()->terminate();
}
+ pingMainloopTimeout("Main:TerminatePump");
delete gServicePump;
gServicePump = NULL;
@@ -1663,6 +1666,11 @@ bool LLAppViewer::doFrame()
LL_INFOS() << "Exiting main_loop" << LL_ENDL;
}
}LLPerfStats::StatsRecorder::endFrame();
+
+ // Not viewer's fault if something outside frame
+ // pauses viewer (ex: macOS doesn't call oneFrame),
+ // so stop tracking on exit.
+ pauseMainloopTimeout();
LL_PROFILER_FRAME_END;
return ! LLApp::isRunning();
@@ -3202,7 +3210,6 @@ bool LLAppViewer::initWindow()
app->createErrorMarker(LAST_EXEC_FROZE);
}
});
- gViewerWindow->getWindow()->initWatchdog();
}
LLNotificationsUI::LLNotificationManager::getInstance();
@@ -4174,6 +4181,7 @@ void LLAppViewer::requestQuit()
return;
}
+ pingMainloopTimeout("Main:qMetrics");
// Try to send metrics back to the grid
metricsSend(!gDisconnected);
@@ -4189,6 +4197,7 @@ void LLAppViewer::requestQuit()
LLHUDManager::getInstance()->sendEffects();
effectp->markDead() ;//remove it.
+ pingMainloopTimeout("Main:qFloaters");
// Attempt to close all floaters that might be
// editing things.
if (gFloaterView)
@@ -4197,6 +4206,7 @@ void LLAppViewer::requestQuit()
gFloaterView->closeAllChildren(true);
mClosingFloaters = true;
}
+ pingMainloopTimeout("Main:qStats");
// Send preferences once, when exiting
bool include_preferences = true;
@@ -4204,6 +4214,7 @@ void LLAppViewer::requestQuit()
gLogoutTimer.reset();
mQuitRequested = true;
+ pingMainloopTimeout("Main:LoggingOut");
}
static bool finish_quit(const LLSD& notification, const LLSD& response)
@@ -4832,6 +4843,11 @@ void LLAppViewer::idle()
LLMortician::updateClass();
LLFilePickerThread::clearDead(); //calls LLFilePickerThread::notify()
LLDirPickerThread::clearDead();
+
+ if (LLWebsocketMgr::instanceExists())
+ {
+ LLWebsocketMgr::instance().update();
+ }
F32 dt_raw = idle_timer.getElapsedTimeAndResetF32();
LLGLTFMaterialList::flushUpdates();
@@ -5503,6 +5519,7 @@ void LLAppViewer::outOfMemorySoftQuit()
LLLFSThread::sLocal->pause();
gLogoutTimer.reset();
mQuitRequested = true;
+ destroyMainloopTimeout();
LLError::LLUserWarningMsg::showOutOfMemory();
}
@@ -5919,10 +5936,16 @@ void LLAppViewer::pingMainloopTimeout(std::string_view state)
F32 LLAppViewer::getMainloopTimeoutSec() const
{
+ if (isQuitting() || mQuitRequested)
+ {
+ constexpr F32 QUITTING_SECONDS = 240.f;
+ return QUITTING_SECONDS;
+ }
if (LLStartUp::getStartupState() == STATE_STARTED
&& gAgent.getTeleportState() == LLAgent::TELEPORT_NONE)
{
- static LLCachedControl<F32> mainloop_started(gSavedSettings, "MainloopTimeoutStarted", 30.f);
+ // consider making this value match 'disconnected' timout.
+ static LLCachedControl<F32> mainloop_started(gSavedSettings, "MainloopTimeoutStarted", 60.f);
return mainloop_started();
}
else
@@ -5936,6 +5959,11 @@ void LLAppViewer::handleLoginComplete()
{
gLoggedInTime.start();
initMainloopTimeout("Mainloop Init");
+ LLWindow* viewer_window = gViewerWindow->getWindow();
+ if (viewer_window) // in case of a headless client
+ {
+ viewer_window->initWatchdog();
+ }
// Store some data to DebugInfo in case of a freeze.
gDebugInfo["ClientInfo"]["Name"] = LLVersionInfo::instance().getChannel();