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.cpp38
1 files changed, 25 insertions, 13 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 4cb3b92476..e95eec4741 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -49,7 +49,6 @@
#include "llviewerstats.h"
#include "llmd5.h"
#include "llpumpio.h"
-#include "llimpanel.h"
#include "llmimetypes.h"
#include "llslurl.h"
#include "llstartup.h"
@@ -76,6 +75,7 @@
#include "llteleporthistory.h"
#include "lllocationhistory.h"
#include "llfasttimerview.h"
+#include "llvoicechannel.h"
#include "llweb.h"
#include "llsecondlifeurls.h"
@@ -205,7 +205,7 @@
#pragma warning (disable:4702)
#endif
-static LLAppViewerListener sAppViewerListener("LLAppViewer", NULL);
+static LLAppViewerListener sAppViewerListener("LLAppViewer", LLAppViewer::instance);
////// Windows-specific includes to the bottom - nasty defines in these pollute the preprocessor
//
@@ -227,7 +227,6 @@ const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user fl
F32 gSimLastTime; // Used in LLAppViewer::init and send_stats()
F32 gSimFrames;
-BOOL gAllowTapTapHoldRun = TRUE;
BOOL gShowObjectUpdates = FALSE;
BOOL gUseQuickTime = TRUE;
@@ -239,8 +238,6 @@ U32 gFrameCount = 0;
U32 gForegroundFrameCount = 0; // number of frames that app window was in foreground
LLPumpIO* gServicePump = NULL;
-BOOL gPacificDaylightTime = FALSE;
-
U64 gFrameTime = 0;
F32 gFrameTimeSeconds = 0.f;
F32 gFrameIntervalSeconds = 0.f;
@@ -421,7 +418,6 @@ static void settings_to_globals()
gAgent.setHideGroupTitle(gSavedSettings.getBOOL("RenderHideGroupTitle"));
gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc");
- gAllowTapTapHoldRun = gSavedSettings.getBOOL("AllowTapTapHoldRun");
gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates");
gMapScale = gSavedSettings.getF32("MapScale");
@@ -624,7 +620,19 @@ bool LLAppViewer::init()
if (!initConfiguration())
return false;
-
+
+ // Although initLogging() is the right place to mess with
+ // setFatalFunction(), we can't query gSavedSettings until after
+ // initConfiguration().
+ S32 rc(gSavedSettings.getS32("QAModeTermCode"));
+ if (rc >= 0)
+ {
+ // QAModeTermCode set, terminate with that rc on LL_ERRS. Use _exit()
+ // rather than exit() because normal cleanup depends too much on
+ // successful startup!
+ LLError::setFatalFunction(boost::bind(_exit, rc));
+ }
+
mAlloc.setProfilingEnabled(gSavedSettings.getBOOL("MemProfiling"));
// *NOTE:Mani - LLCurl::initClass is not thread safe.
@@ -1206,6 +1214,9 @@ bool LLAppViewer::mainLoop()
bool LLAppViewer::cleanup()
{
+ // workaround for DEV-35406 crash on shutdown
+ LLEventPumps::instance().reset();
+
// *TODO - generalize this and move DSO wrangling to a helper class -brad
std::set<struct apr_dso_handle_t *>::const_iterator i;
for(i = mPlugins.begin(); i != mPlugins.end(); ++i)
@@ -1214,9 +1225,7 @@ bool LLAppViewer::cleanup()
apr_status_t rv = apr_dso_sym((apr_dso_handle_sym_t*)&ll_plugin_stop_func, *i, "ll_plugin_stop");
ll_plugin_stop_func();
- // *NOTE - disabled unloading as partial solution to DEV-35406 crash on shutdown
- //rv = apr_dso_unload(*i);
- (void)rv;
+ rv = apr_dso_unload(*i);
}
mPlugins.clear();
@@ -1349,7 +1358,11 @@ bool LLAppViewer::cleanup()
// Destroy the UI
if( gViewerWindow)
gViewerWindow->shutdownViews();
-
+
+ // Cleanup Inventory after the UI since it will delete any remaining observers
+ // (Deleted observers should have already removed themselves)
+ gInventory.cleanupInventory();
+
// Clean up selection managers after UI is destroyed, as UI may be observing them.
// Clean up before GL is shut down because we might be holding on to objects with texture references
LLSelectMgr::cleanupGlobals();
@@ -1664,7 +1677,7 @@ bool LLAppViewer::initLogging()
LLError::initForApplication(
gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, ""));
LLError::setFatalFunction(errorCallback);
-
+
// Remove the last ".old" log file.
std::string old_log_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS,
"SecondLife.old");
@@ -2399,7 +2412,6 @@ void LLAppViewer::cleanupSavedSettings()
gSavedSettings.setBOOL("DebugWindowProc", gDebugWindowProc);
- gSavedSettings.setBOOL("AllowTapTapHoldRun", gAllowTapTapHoldRun);
gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates);
if (!gNoRender)