diff options
| author | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-08-11 01:34:13 +0300 |
|---|---|---|
| committer | Andrey Lihatskiy <alihatskiy@productengine.com> | 2020-08-11 01:34:13 +0300 |
| commit | 9406b757a36d409e93a0ccde0a1fea289a3e6118 (patch) | |
| tree | bac8ea172ccf40ea836d1b750d73e5d2cc5e11e4 /indra/llcommon/llapp.cpp | |
| parent | f554fe2ca74ddf275e47cdce8537e04ab40f9f95 (diff) | |
| parent | 2e66c406d1767f26f968452e9ca5f5c0afa513b2 (diff) | |
Merge branch 'DRTVWR-501-maint' into DRTVWR-503-maint
# Conflicts:
# indra/cmake/DirectX.cmake
# indra/newview/llviewerparcelmedia.cpp
# indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/llcommon/llapp.cpp')
| -rw-r--r-- | indra/llcommon/llapp.cpp | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp index 421af3006e..3dab632aef 100644 --- a/indra/llcommon/llapp.cpp +++ b/indra/llcommon/llapp.cpp @@ -49,6 +49,8 @@ #include "google_breakpad/exception_handler.h" #include "stringize.h" #include "llcleanup.h" +#include "llevents.h" +#include "llsdutil.h" // // Signal handling @@ -561,10 +563,42 @@ void LLApp::runErrorHandler() LLApp::setStopped(); } +namespace +{ + +static std::map<LLApp::EAppStatus, const char*> statusDesc +{ + { LLApp::APP_STATUS_RUNNING, "running" }, + { LLApp::APP_STATUS_QUITTING, "quitting" }, + { LLApp::APP_STATUS_STOPPED, "stopped" }, + { LLApp::APP_STATUS_ERROR, "error" } +}; + +} // anonymous namespace + // static void LLApp::setStatus(EAppStatus status) { - sStatus = status; + sStatus = status; + + // This can also happen very late in the application lifecycle -- don't + // resurrect a deleted LLSingleton + if (! LLEventPumps::wasDeleted()) + { + // notify interested parties of status change + LLSD statsd; + auto found = statusDesc.find(status); + if (found != statusDesc.end()) + { + statsd = found->second; + } + else + { + // unknown status? at least report value + statsd = LLSD::Integer(status); + } + LLEventPumps::instance().obtain("LLApp").post(llsd::map("status", statsd)); + } } |
