diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2012-03-15 16:16:05 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2012-03-15 16:16:05 -0400 |
commit | 2a6f919cdbe5c878444a722fe91768ccd4e46c98 (patch) | |
tree | 77e0717ca0be8579b1abfdd52db20974935d1f66 | |
parent | 7de3161fa866bc415b4b87f26ca3f7fc3670af78 (diff) |
Explicitly clean up all LLLeap instances during viewer shutdown.
This code replaces the previous cleanup of DLLs loaded by APR.
-rw-r--r-- | indra/newview/llappviewer.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 7e0162d026..f18e5d2c9e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1544,6 +1544,25 @@ bool LLAppViewer::cleanup() gDirUtilp->deleteFilesInDir(logdir, "*-*-*-*-*.dmp"); } + { + // Kill off LLLeap objects. We can find them all because LLLeap is derived + // from LLInstanceTracker. But collect instances first: LLInstanceTracker + // specifically forbids adding/deleting instances while iterating. + std::vector<LLLeap*> leaps; + leaps.reserve(LLLeap::instanceCount()); + for (LLLeap::instance_iter li(LLLeap::beginInstances()), lend(LLLeap::endInstances()); + li != lend; ++li) + { + leaps.push_back(&*li); + } + // Okay, now trash them all. We don't have to NULL or erase the entry + // in 'leaps' because the whole vector is going away momentarily. + BOOST_FOREACH(LLLeap* leap, leaps) + { + delete leap; + } + } // destroy 'leaps' + //flag all elements as needing to be destroyed immediately // to ensure shutdown order LLMortician::setZealous(TRUE); |