From 8f54dc2958e75587165623b0292940200fb49f59 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Wed, 26 Jan 2011 11:13:04 -0700 Subject: for SH-846: design and implement the debug code to locate memory leaking --- indra/newview/llappviewer.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6a9dfaf21b..87c0085226 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1057,6 +1057,8 @@ bool LLAppViewer::mainLoop() //clear call stack records llclearcallstacks; + MEM_TRACK + //check memory availability information { if(memory_check_interval < memCheckTimer.getElapsedTimeF32()) @@ -1101,6 +1103,8 @@ bool LLAppViewer::mainLoop() } #endif + MEM_TRACK + //memory leaking simulation LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance("mem_leaking"); @@ -1162,6 +1166,8 @@ bool LLAppViewer::mainLoop() resumeMainloopTimeout(); } + MEM_TRACK + if (gDoDisconnect && (LLStartUp::getStartupState() == STATE_STARTED)) { pauseMainloopTimeout(); @@ -1183,6 +1189,8 @@ bool LLAppViewer::mainLoop() } + MEM_TRACK + pingMainloopTimeout("Main:Sleep"); pauseMainloopTimeout(); @@ -1296,7 +1304,10 @@ bool LLAppViewer::mainLoop() resumeMainloopTimeout(); pingMainloopTimeout("Main:End"); - } + } + + MEM_TRACK + } catch(std::bad_alloc) { @@ -1779,6 +1790,8 @@ bool LLAppViewer::cleanup() ll_close_fail_log(); + MEM_TRACK_RELEASE + llinfos << "Goodbye!" << llendflush; // return 0; -- cgit v1.2.3 From 60696ae986c90068faa0191db737431493796dc1 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Wed, 26 Jan 2011 16:31:15 -0800 Subject: fix for STORM-940: don't show manditory update dialog if already logged in. --- indra/newview/llappviewer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e92042bcd4..ace1de6131 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2474,10 +2474,14 @@ namespace { // The user never saw the progress bar. notification_name = "RequiredUpdateDownloadedVerboseDialog"; } - else + else if(LLStartUp::getStartupState() < STATE_WORLD_INIT) { notification_name = "RequiredUpdateDownloadedDialog"; } + else + { + ; // Do nothing because user is already logged in. + } } else { -- cgit v1.2.3 From 9653c41d3d0532a323122b0cd1b6399721bf8be8 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Thu, 27 Jan 2011 11:37:00 -0800 Subject: more for storm 940: treat the manditory download after login like an optional one. --- indra/newview/llappviewer.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ace1de6131..9cc0ab377c 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2468,19 +2468,23 @@ namespace { if(data["required"].asBoolean()) { - apply_callback = &apply_update_ok_callback; if(LLStartUp::getStartupState() <= STATE_LOGIN_WAIT) { // The user never saw the progress bar. + apply_callback = &apply_update_ok_callback; notification_name = "RequiredUpdateDownloadedVerboseDialog"; } else if(LLStartUp::getStartupState() < STATE_WORLD_INIT) { + // The user is logging in but blocked. + apply_callback = &apply_update_ok_callback; notification_name = "RequiredUpdateDownloadedDialog"; } else { - ; // Do nothing because user is already logged in. + // The user is already logged in; treat like an optional update. + apply_callback = &apply_update_callback; + notification_name = "DownloadBackgroundDialog"; } } else -- cgit v1.2.3 From f18bfd446b5b9a9cf91bf8b615c651074ebe8596 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Thu, 27 Jan 2011 11:37:59 -0800 Subject: STORM-940: use the tip, not the dialog. --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 9cc0ab377c..9361ae20cf 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2484,7 +2484,7 @@ namespace { { // The user is already logged in; treat like an optional update. apply_callback = &apply_update_callback; - notification_name = "DownloadBackgroundDialog"; + notification_name = "DownloadBackgroundTip"; } } else -- cgit v1.2.3 From 948afb8ef436f661dd84e3c343e22934f92570ec Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Fri, 28 Jan 2011 21:23:19 -0700 Subject: trivial: remove some debug code. --- indra/newview/llappviewer.cpp | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 87c0085226..69333ff4a3 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1057,8 +1057,6 @@ bool LLAppViewer::mainLoop() //clear call stack records llclearcallstacks; - MEM_TRACK - //check memory availability information { if(memory_check_interval < memCheckTimer.getElapsedTimeF32()) @@ -1103,8 +1101,6 @@ bool LLAppViewer::mainLoop() } #endif - MEM_TRACK - //memory leaking simulation LLFloaterMemLeak* mem_leak_instance = LLFloaterReg::findTypedInstance("mem_leaking"); @@ -1166,8 +1162,6 @@ bool LLAppViewer::mainLoop() resumeMainloopTimeout(); } - MEM_TRACK - if (gDoDisconnect && (LLStartUp::getStartupState() == STATE_STARTED)) { pauseMainloopTimeout(); @@ -1189,8 +1183,6 @@ bool LLAppViewer::mainLoop() } - MEM_TRACK - pingMainloopTimeout("Main:Sleep"); pauseMainloopTimeout(); @@ -1305,9 +1297,6 @@ bool LLAppViewer::mainLoop() pingMainloopTimeout("Main:End"); } - - MEM_TRACK - } catch(std::bad_alloc) { -- cgit v1.2.3 From 774405e92bec6bdfa9e2be28e04b4b47fd71615e Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 18 Feb 2011 23:16:38 +0000 Subject: Cleanup of headless client (was: DisableRendering mode) * Now called 'HeadlessClient' instead of 'DisableRendering' * Removed most cases where we skipped certain behaviors in the client when in this mode. This gets us closer to a 'true' client, for testing purposes. --- indra/newview/llappviewer.cpp | 118 +++++++++++++++++++----------------------- 1 file changed, 52 insertions(+), 66 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 6a9dfaf21b..25bdaed0c9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -881,7 +881,7 @@ bool LLAppViewer::init() } // If we don't have the right GL requirements, exit. - if (!gGLManager.mHasRequirements && !gNoRender) + if (!gGLManager.mHasRequirements) { // can't use an alert here since we're exiting and // all hell breaks lose. @@ -1171,7 +1171,8 @@ bool LLAppViewer::mainLoop() } // Render scene. - if (!LLApp::isExiting()) + // *TODO: Should we run display() even during gHeadlessClient? DK 2011-02-18 + if (!LLApp::isExiting() && !gHeadlessClient) { pingMainloopTimeout("Main:Display"); gGLActive = TRUE; @@ -1199,8 +1200,7 @@ bool LLAppViewer::mainLoop() } // yield cooperatively when not running as foreground window - if ( gNoRender - || (gViewerWindow && !gViewerWindow->mWindow->getVisible()) + if ( (gViewerWindow && !gViewerWindow->mWindow->getVisible()) || !gFocusMgr.getAppHasFocus()) { // Sleep if we're not rendering, or the window is minimized. @@ -2640,7 +2640,8 @@ bool LLAppViewer::initWindow() LL_INFOS("AppInit") << "Initializing window..." << LL_ENDL; // store setting in a global for easy access and modification - gNoRender = gSavedSettings.getBOOL("DisableRendering"); + gHeadlessClient = gSavedSettings.getBOOL("DisableRendering") + || gSavedSettings.getBOOL("HeadlessClient"); // always start windowed BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth"); @@ -2676,28 +2677,25 @@ bool LLAppViewer::initWindow() gViewerWindow->mWindow->maximize(); } - if (!gNoRender) + // + // Initialize GL stuff + // + + if (mForceGraphicsDetail) { - // - // Initialize GL stuff - // + LLFeatureManager::getInstance()->setGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance"), false); + } + + // Set this flag in case we crash while initializing GL + gSavedSettings.setBOOL("RenderInitError", TRUE); + gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); - if (mForceGraphicsDetail) - { - LLFeatureManager::getInstance()->setGraphicsLevel(gSavedSettings.getU32("RenderQualityPerformance"), false); - } - - // Set this flag in case we crash while initializing GL - gSavedSettings.setBOOL("RenderInitError", TRUE); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); - - gPipeline.init(); - stop_glerror(); - gViewerWindow->initGLDefaults(); + gPipeline.init(); + stop_glerror(); + gViewerWindow->initGLDefaults(); - gSavedSettings.setBOOL("RenderInitError", FALSE); - gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); - } + gSavedSettings.setBOOL("RenderInitError", FALSE); + gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); //If we have a startup crash, it's usually near GL initialization, so simulate that. if(gCrashOnStartup) @@ -2739,12 +2737,9 @@ void LLAppViewer::cleanupSavedSettings() gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates); - if (!gNoRender) + if (gDebugView) { - if (gDebugView) - { - gSavedSettings.setBOOL("ShowDebugConsole", gDebugView->mDebugConsolep->getVisible()); - } + gSavedSettings.setBOOL("ShowDebugConsole", gDebugView->mDebugConsolep->getVisible()); } // save window position if not maximized @@ -3711,7 +3706,7 @@ void LLAppViewer::badNetworkHandler() // is destroyed. void LLAppViewer::saveFinalSnapshot() { - if (!mSavedFinalSnapshot && !gNoRender) + if (!mSavedFinalSnapshot) { gSavedSettings.setVector3d("FocusPosOnLogout", gAgentCamera.calcFocusPositionTargetGlobal()); gSavedSettings.setVector3d("CameraPosOnLogout", gAgentCamera.calcCameraPositionTargetGlobal()); @@ -4115,34 +4110,31 @@ void LLAppViewer::idle() // // Update weather effects // - if (!gNoRender) - { - LLWorld::getInstance()->updateClouds(gFrameDTClamped); - gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets + LLWorld::getInstance()->updateClouds(gFrameDTClamped); + gSky.propagateHeavenlyBodies(gFrameDTClamped); // moves sun, moon, and planets - // Update wind vector - LLVector3 wind_position_region; - static LLVector3 average_wind; + // Update wind vector + LLVector3 wind_position_region; + static LLVector3 average_wind; - LLViewerRegion *regionp; - regionp = LLWorld::getInstance()->resolveRegionGlobal(wind_position_region, gAgent.getPositionGlobal()); // puts agent's local coords into wind_position - if (regionp) - { - gWindVec = regionp->mWind.getVelocity(wind_position_region); + LLViewerRegion *regionp; + regionp = LLWorld::getInstance()->resolveRegionGlobal(wind_position_region, gAgent.getPositionGlobal()); // puts agent's local coords into wind_position + if (regionp) + { + gWindVec = regionp->mWind.getVelocity(wind_position_region); - // Compute average wind and use to drive motion of water - - average_wind = regionp->mWind.getAverage(); - F32 cloud_density = regionp->mCloudLayer.getDensityRegion(wind_position_region); - - gSky.setCloudDensityAtAgent(cloud_density); - gSky.setWind(average_wind); - //LLVOWater::setWind(average_wind); - } - else - { - gWindVec.setVec(0.0f, 0.0f, 0.0f); - } + // Compute average wind and use to drive motion of water + + average_wind = regionp->mWind.getAverage(); + F32 cloud_density = regionp->mCloudLayer.getDensityRegion(wind_position_region); + + gSky.setCloudDensityAtAgent(cloud_density); + gSky.setWind(average_wind); + //LLVOWater::setWind(average_wind); + } + else + { + gWindVec.setVec(0.0f, 0.0f, 0.0f); } ////////////////////////////////////// @@ -4151,13 +4143,10 @@ void LLAppViewer::idle() // Here, particles are updated and drawables are moved. // - if (!gNoRender) - { - LLFastTimer t(FTM_WORLD_UPDATE); - gPipeline.updateMove(); + LLFastTimer t(FTM_WORLD_UPDATE); + gPipeline.updateMove(); - LLWorld::getInstance()->updateParticles(); - } + LLWorld::getInstance()->updateParticles(); if (LLViewerJoystick::getInstance()->getOverrideCamera()) { @@ -4523,12 +4512,9 @@ void LLAppViewer::disconnectViewer() gSavedSettings.setBOOL("FlyingAtExit", gAgent.getFlying() ); // Un-minimize all windows so they don't get saved minimized - if (!gNoRender) + if (gFloaterView) { - if (gFloaterView) - { - gFloaterView->restoreAll(); - } + gFloaterView->restoreAll(); } if (LLSelectMgr::getInstance()) -- cgit v1.2.3 From 3f5760b5ee4e422e11f3416133b7a4c3a73b1d8c Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Fri, 18 Feb 2011 23:53:38 +0000 Subject: More cleanup from self-reviewing headless client changes --- indra/newview/llappviewer.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra/newview/llappviewer.cpp') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 25bdaed0c9..0595d6f3c7 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2640,8 +2640,7 @@ bool LLAppViewer::initWindow() LL_INFOS("AppInit") << "Initializing window..." << LL_ENDL; // store setting in a global for easy access and modification - gHeadlessClient = gSavedSettings.getBOOL("DisableRendering") - || gSavedSettings.getBOOL("HeadlessClient"); + gHeadlessClient = gSavedSettings.getBOOL("HeadlessClient"); // always start windowed BOOL ignorePixelDepth = gSavedSettings.getBOOL("IgnorePixelDepth"); -- cgit v1.2.3