diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2021-11-30 15:22:26 -0500 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2021-11-30 17:00:09 -0500 |
commit | 01317a2faded53c79db7e0814426f1d8b2fd12fc (patch) | |
tree | 75e42096bc5ed2cdff78a4a7a58d873f9bff9a83 /indra/newview/llappviewer.cpp | |
parent | 9be88050e67edcb8578ce6edbee255ba66e553a1 (diff) |
SL-16421: Destroy the "General" ThreadPool as soon as cleanup starts.
Introduce LLAppViewer::onCleanup(), a method that accepts a nullary callable
to execute once viewer shutdown begins. Fire the collected callables in
LLAppViewer::cleanup().
In llstartup.cpp, instead of declaring a static unique_ptr and relying on
static object destruction to clean up the "General" ThreadPool, bind the
pointer to the new ThreadPool into an onCleanup() lambda that will delete it
when called. ~ThreadPool() takes care of orderly shutdown.
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r-- | indra/newview/llappviewer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 529db397b2..a5d32ba243 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1729,6 +1729,11 @@ void LLAppViewer::flushVFSIO() bool LLAppViewer::cleanup() { + // Since we don't know what functions are going to be queued by + // onCleanup(), we have to assume they might rely on some of the things + // we're about to destroy below. Run them first. + mOnCleanup(); + LLAtmosphere::cleanupClass(); //ditch LLVOAvatarSelf instance |