From d2597d35cf3aeaf0c47a134dfe9119ef7932b98a Mon Sep 17 00:00:00 2001
From: Steven Bennetts <steve@lindenlab.com>
Date: Thu, 17 Apr 2008 02:25:04 +0000
Subject: Undid previous commit (bogus merge)

---
 indra/llcommon/llapp.cpp                           | 24 +------
 indra/llcommon/llapp.h                             |  5 +-
 indra/llcommon/llversionviewer.h                   |  6 +-
 indra/newview/app_settings/cmd_line.xml            | 16 -----
 .../shaders/class1/environment/waterF.glsl         |  2 +-
 indra/newview/featuretable.txt                     | 18 ------
 indra/newview/gpu_table.txt                        | 12 +---
 indra/newview/llappviewer.cpp                      | 31 +--------
 indra/newview/llappviewerlinux.cpp                 | 73 ++++++++--------------
 indra/newview/llappviewerlinux.h                   |  1 -
 indra/newview/llappviewermacosx.cpp                |  5 --
 indra/newview/llappviewermacosx.h                  |  4 +-
 indra/newview/llappviewerwin32.cpp                 |  5 --
 indra/newview/llappviewerwin32.h                   |  5 +-
 indra/newview/lldebugview.cpp                      |  5 +-
 indra/newview/llfloatercamera.cpp                  | 64 ++++++++++++++++---
 indra/newview/llfloaterlagmeter.cpp                | 13 +++-
 indra/newview/llfloaterlagmeter.h                  |  9 +--
 indra/newview/llfloaterpreference.cpp              |  5 +-
 indra/newview/llmoveview.cpp                       | 60 +++++++++++++++---
 indra/newview/llmoveview.h                         | 20 +++---
 indra/newview/llnetmap.cpp                         |  6 +-
 indra/newview/lltexturefetch.cpp                   | 47 +++++++-------
 indra/newview/llvieweraudio.h                      |  6 --
 indra/newview/llviewermenu.cpp                     | 10 +--
 indra/newview/llviewermessage.cpp                  |  4 +-
 indra/newview/llviewerwindow.cpp                   |  1 +
 indra/newview/llvovolume.cpp                       | 18 +-----
 indra/newview/llworld.cpp                          |  6 +-
 indra/newview/viewer_manifest.py                   |  4 +-
 30 files changed, 216 insertions(+), 269 deletions(-)

diff --git a/indra/llcommon/llapp.cpp b/indra/llcommon/llapp.cpp
index d034334aab..067dc4fc43 100644
--- a/indra/llcommon/llapp.cpp
+++ b/indra/llcommon/llapp.cpp
@@ -78,7 +78,6 @@ BOOL LLApp::sLogInSignal = FALSE;
 // static
 LLApp::EAppStatus LLApp::sStatus = LLApp::APP_STATUS_STOPPED; // Keeps track of application status
 LLAppErrorHandler LLApp::sErrorHandler = NULL;
-LLAppErrorHandler LLApp::sSyncErrorHandler = NULL;
 BOOL LLApp::sErrorThreadRunning = FALSE;
 #if !LL_WINDOWS
 LLApp::child_map LLApp::sChildMap;
@@ -276,21 +275,6 @@ void LLApp::setErrorHandler(LLAppErrorHandler handler)
 	LLApp::sErrorHandler = handler;
 }
 
-
-void LLApp::setSyncErrorHandler(LLAppErrorHandler handler)
-{
-	LLApp::sSyncErrorHandler = handler;
-}
-
-// static
-void LLApp::runSyncErrorHandler()
-{
-	if (LLApp::sSyncErrorHandler)
-	{
-		LLApp::sSyncErrorHandler();
-	}
-}
-
 // static
 void LLApp::runErrorHandler()
 {
@@ -314,13 +298,7 @@ void LLApp::setStatus(EAppStatus status)
 // static
 void LLApp::setError()
 {
-	if (!isError())
-	{
-		// perform any needed synchronous error-handling
-		runSyncErrorHandler();
-		// set app status to ERROR so that the LLErrorThread notices
-		setStatus(APP_STATUS_ERROR);
-	}
+	setStatus(APP_STATUS_ERROR);
 }
 
 
diff --git a/indra/llcommon/llapp.h b/indra/llcommon/llapp.h
index c5a1546883..c199601c20 100644
--- a/indra/llcommon/llapp.h
+++ b/indra/llcommon/llapp.h
@@ -190,7 +190,6 @@ public:
 	// Error handling methods
 	//
 	void setErrorHandler(LLAppErrorHandler handler);
-	void setSyncErrorHandler(LLAppErrorHandler handler);
 
 #if !LL_WINDOWS
 	//
@@ -247,15 +246,13 @@ protected:
 private:
 	void setupErrorHandling();		// Do platform-specific error-handling setup (signals, structured exceptions)
 
-	static void runErrorHandler(); // run shortly after we detect an error, ran in the relatively robust context of the LLErrorThread - preferred.
-	static void runSyncErrorHandler(); // run IMMEDIATELY when we get an error, ran in the context of the faulting thread.
+	static void runErrorHandler();
 
 	// *NOTE: On Windows, we need a routine to reset the structured
 	// exception handler when some evil driver has taken it over for
 	// their own purposes
 	typedef int(*signal_handler_func)(int signum);
 	static LLAppErrorHandler sErrorHandler;
-	static LLAppErrorHandler sSyncErrorHandler;
 
 	// Default application threads
 	LLErrorThread* mThreadErrorp;		// Waits for app to go to status ERROR, then runs the error callback
diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h
index c586acc7d9..8e964d3891 100644
--- a/indra/llcommon/llversionviewer.h
+++ b/indra/llcommon/llversionviewer.h
@@ -33,9 +33,9 @@
 #define LL_LLVERSIONVIEWER_H
 
 const S32 LL_VERSION_MAJOR = 1;
-const S32 LL_VERSION_MINOR = 20;
-const S32 LL_VERSION_PATCH = 0;
-const S32 LL_VERSION_BUILD = 0;
+const S32 LL_VERSION_MINOR = 19;
+const S32 LL_VERSION_PATCH = 1;
+const S32 LL_VERSION_BUILD = 84396;
 
 const char * const LL_CHANNEL = "Second Life Release";
 
diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml
index 43c3d85679..01c590c1f3 100644
--- a/indra/newview/app_settings/cmd_line.xml
+++ b/indra/newview/app_settings/cmd_line.xml
@@ -319,21 +319,5 @@
       <string>LoginPage</string>
     </map>
 
-    <key>qa</key>
-    <map>
-      <key>desc</key>
-      <string>Activated debugging menu in Advanced Settings.</string>
-      <key>map-to</key>
-      <string>QAMode</string>
-    </map>
-
-    <key>crashonstartup</key>
-    <map>
-      <key>desc</key>
-      <string>Crashes on startup. For QA use.</string>
-      <key>map-to</key>
-      <string>CrashOnStartup</string>
-    </map>
-
   </map>
 </llsd>
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
index bd9b30a075..7b9e4ff828 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl
@@ -86,7 +86,7 @@ void main()
 	color.rgb = mix(mix(fogCol.rgb, fb.rgb, fogCol.a), refcol.rgb, df);
 	color.rgb += spec * specular;
 	
-	//color.rgb = applyWaterFog(color);//atmosTransport(color.rgb);
+	color.rgb = applyWaterFog(color);//atmosTransport(color.rgb);
 	color.rgb = scaleSoftClip(color.rgb);
 	color.a = spec * sunAngle2;
 
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 032d9bfdc3..5f81027b10 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -250,9 +250,6 @@ RenderMaxPartCount			1	2048
 RenderTerrainDetail			1	0
 RenderVBOEnable				1	1
 
-list SiS
-UseOcclusion				0	0
-
 
 list Intel_830M
 RenderTerrainDetail			1	0
@@ -323,25 +320,10 @@ list Intel_Springdale
 RenderTerrainDetail			1	0
 RenderVBOEnable				1	0
 
-
 list ATI_FireGL_5200
 RenderVBOEnable				1	0
 WindLightUseAtmosShaders	0	0
 
-
-list ATI_Mobility_Radeon_7xxx
-RenderVBOEnable				0	0
-
-list ATI_Radeon_7xxx
-RenderVBOEnable				0	0
-
-list ATI_All-in-Wonder_Radeon
-RenderVBOEnable				0	0
-
-list ATI_All-in-Wonder_7500
-RenderVBOEnable				0	0
-
-
 list ATI_Mobility_Radeon_9800
 RenderAvatarCloth			0	0
 VertexShaderEnable			0	0
diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt
index 842e1afaad..c75edc8565 100644
--- a/indra/newview/gpu_table.txt
+++ b/indra/newview/gpu_table.txt
@@ -22,16 +22,12 @@
 3Dfx							.*3Dfx.*							0		0
 3Dlabs							.*3Dlabs.*							0		0
 ATI 3D-Analyze					.*ATI.*3D-Analyze.*					0		0
-ATI All-in-Wonder 7500			.*ATI.*All-in-Wonder 75.*			0		1
-ATI All-in-Wonder 8500			.*ATI.*All-in-Wonder 85.*			0		1
-ATI All-in-Wonder 9200			.*ATI.*All-in-Wonder 92.*			0		1
+ATI All-in-Wonder PCI-E			.*ATI.*All-in-Wonder.*PCI-E.*		1		1
 ATI All-in-Wonder 9xxx			.*ATI.*All-in-Wonder 9.*			1		1
 ATI All-in-Wonder X600			.*ATI.*All-in-Wonder X6.*			1		1
 ATI All-in-Wonder X800			.*ATI.*All-in-Wonder X8.*			2		1
 ATI All-in-Wonder X1800			.*ATI.*All-in-Wonder X18.*			3		1
 ATI All-in-Wonder X1900			.*ATI.*All-in-Wonder X19.*			3		1
-ATI All-in-Wonder PCI-E			.*ATI.*All-in-Wonder.*PCI-E.*		1		1
-ATI All-in-Wonder Radeon 		.*ATI.*All-in-Wonder Radeon.*		0		1
 ATI ASUS A9xxx					.*ATI.*ASUS.*A9.*					1		1
 ATI ASUS AH24xx					.*ATI.*ASUS.*AH24.*					1		1
 ATI ASUS AH26xx					.*ATI.*ASUS.*AH26.*					3		1
@@ -56,8 +52,6 @@ ATI M52							.*ATI.*M52.*						1		1
 ATI M54							.*ATI.*M54.*						1		1
 ATI M56							.*ATI.*M56.*						1		1
 ATI M76							.*ATI.*M76.*						3		1
-ATI Mobility Radeon 7xxx		.*ATI.*Mobility.*Radeon 7.*			0		1
-ATI Mobility Radeon 8xxx		.*ATI.*Mobility.*Radeon 8.*			0		1
 ATI Mobility Radeon 9800		.*ATI.*Mobility.*98.*				1		1
 ATI Mobility Radeon 9700		.*ATI.*Mobility.*97.*				1		1
 ATI Mobility Radeon 9600		.*ATI.*Mobility.*96.*				0		1
@@ -76,8 +70,8 @@ ATI Radeon HD 3400				.*ATI.*Radeon HD 34.*				1		1
 ATI Radeon HD 3600				.*ATI.*Radeon HD 36.*				3		1
 ATI Radeon HD 3800				.*ATI.*Radeon HD 38.*				3		1
 ATI Radeon OpenGL				.*ATI.*Radeon OpenGL.* 				0		0
-ATI Radeon 7xxx					.*ATI.*Radeon 7.*					0		1
-ATI Radeon 8xxx					.*ATI.*Radeon 8.*					0		1
+ATI Radeon 7000					.*ATI.*Radeon 7.*					0		1
+ATI Radeon 8000					.*ATI.*Radeon 8.*					0		1
 ATI Radeon 9000					.*ATI.*Radeon 90.*					0		1
 ATI Radeon 9100					.*ATI.*Radeon 91.*					0		1
 ATI Radeon 9200					.*ATI.*Radeon 92.*					0		1
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index b360d9a8e5..3d10eda7fd 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -152,7 +152,6 @@
 #include "llvieweraudio.h"
 #include "llimview.h"
 #include "llviewerthrottle.h"
-#include "llparcel.h"
 // 
 
 #include "llinventoryview.h"
@@ -1564,12 +1563,6 @@ bool LLAppViewer::initConfiguration()
 		llinfos	<< "Command	line usage:\n" << clp << llendl;
 	}
 
-	// If we have specified crash on startup, might as well do it now.
-	if(clp.hasOption("crashonstartup"))
-	{
-		LLAppViewer::instance()->forceErrorLLError();
-	}
-	
 	// If the user has specified a alternate settings file name.
 	// Load	it now.
 	if(clp.hasOption("settings"))
@@ -2143,13 +2136,6 @@ void LLAppViewer::writeSystemInfo()
 	llinfos << "OS info: " << getOSInfo() << llendl;
 }
 
-void LLAppViewer::handleSyncViewerCrash()
-{
-	LLAppViewer* pApp = LLAppViewer::instance();
-	// Call to pure virtual, handled by platform specific llappviewer instance.
-	pApp->handleSyncCrashTrace(); 
-}
-
 void LLAppViewer::handleViewerCrash()
 {
 	LLAppViewer* pApp = LLAppViewer::instance();
@@ -2175,17 +2161,6 @@ void LLAppViewer::handleViewerCrash()
 	gDebugInfo["ClientInfo"]["MinorVersion"] = LL_VERSION_MINOR;
 	gDebugInfo["ClientInfo"]["PatchVersion"] = LL_VERSION_PATCH;
 	gDebugInfo["ClientInfo"]["BuildVersion"] = LL_VERSION_BUILD;
-
-	LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
-	if ( parcel && parcel->getMusicURL()[0])
-	{
-		gDebugInfo["ParcelMusicURL"] = parcel->getMusicURL();
-	}	
-	if ( parcel && parcel->getMediaURL()[0])
-	{
-		gDebugInfo["ParcelMediaURL"] = parcel->getMediaURL();
-	}
-	
 	
 	gDebugInfo["SettingsFilename"] = gSavedSettings.getString("ClientSettingsFile");
 	gDebugInfo["CAFilename"] = gDirUtilp->getCAFile();
@@ -2261,7 +2236,7 @@ void LLAppViewer::handleViewerCrash()
 		pApp->removeMarkerFile(false);
 	}
 	
-	// Call to pure virtual, handled by platform specific llappviewer instance.
+	// Call to pure virtual, handled by platform specifc llappviewer instance.
 	pApp->handleCrashReporting(); 
 
 	return;
@@ -2831,7 +2806,6 @@ void LLAppViewer::badNetworkHandler()
 	// Generates the minidump.
 	LLWinDebug::handleException(NULL);
 #endif
-	LLAppViewer::handleSyncViewerCrash();
 	LLAppViewer::handleViewerCrash();
 
 	std::ostringstream message;
@@ -2865,8 +2839,7 @@ void LLAppViewer::saveFinalSnapshot()
 		LLString snap_filename = gDirUtilp->getLindenUserDir();
 		snap_filename += gDirUtilp->getDirDelimiter();
 		snap_filename += SCREEN_LAST_FILENAME;
-		// use full pixel dimensions of viewer window (not post-scale dimensions)
-		gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, TRUE);
+		gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, TRUE);
 		mSavedFinalSnapshot = TRUE;
 	}
 }
diff --git a/indra/newview/llappviewerlinux.cpp b/indra/newview/llappviewerlinux.cpp
index d7a8e66a4b..c36dd2955e 100644
--- a/indra/newview/llappviewerlinux.cpp
+++ b/indra/newview/llappviewerlinux.cpp
@@ -39,41 +39,27 @@
 #include "llviewernetwork.h"
 #include "llmd5.h"
 
-#include <exception>
-
-#if LL_LINUX
-# include <dlfcn.h>		// RTLD_LAZY
-# include <execinfo.h>            // backtrace - glibc only
-# ifndef LL_ELFBIN
-#  define LL_ELFBIN 1
-# endif // LL_ELFBIN
-# if LL_ELFBIN
-#  include <cxxabi.h>         // for symbol demangling
-#  include "ELFIO.h"          // for better backtraces
-# endif // LL_ELFBIN
-#elif LL_SOLARIS
-# include <sys/types.h>
-# include <unistd.h>
-# include <fcntl.h>
-# include <ucontext.h>
-#endif
+  #if LL_LINUX
+  #	include <dlfcn.h>		// RTLD_LAZY
+  #     include <execinfo.h>            // backtrace - glibc only
+  #     ifndef LL_ELFBIN
+  #define LL_ELFBIN 1
+  #     endif // LL_ELFBIN
+  #     if LL_ELFBIN
+  #          include <cxxabi.h>         // for symbol demangling
+  #          include "ELFIO.h"          // for better backtraces
+  #     endif // LL_ELFBIN
+  #elif LL_SOLARIS
+  #     include <sys/types.h>
+  #     include <unistd.h>
+  #     include <fcntl.h>
+  #     include <ucontext.h>
+  #endif
 
 namespace
 {
 	int gArgC = 0;
 	char **gArgV = NULL;
-	void (*gOldTerminateHandler)() = NULL;
-}
-
-static void exceptionTerminateHandler()
-{
-	// reinstall default terminate() handler in case we re-terminate.
-	if (gOldTerminateHandler) std::set_terminate(gOldTerminateHandler);
-	// treat this like a regular viewer crash, with nice stacktrace etc.
-	LLAppViewer::handleSyncViewerCrash();
-	LLAppViewer::handleViewerCrash();
-	// we've probably been killed-off before now, but...
-	gOldTerminateHandler(); // call old terminate() handler
 }
 
 int main( int argc, char **argv ) 
@@ -89,11 +75,7 @@ int main( int argc, char **argv )
 
 	LLAppViewer* viewer_app_ptr = new LLAppViewerLinux();
 
-	// install unexpected exception handler
-	gOldTerminateHandler = std::set_terminate(exceptionTerminateHandler);
-	// install crash handlers
 	viewer_app_ptr->setErrorHandler(LLAppViewer::handleViewerCrash);
-	viewer_app_ptr->setSyncErrorHandler(LLAppViewer::handleSyncViewerCrash);
 
 	bool ok = viewer_app_ptr->init();
 	if(!ok)
@@ -319,22 +301,19 @@ bool LLAppViewerLinux::init()
 	return LLAppViewer::init();
 }
 
-void LLAppViewerLinux::handleSyncCrashTrace()
-{
-	// This backtrace writes into stack_trace.log
-#  if LL_ELFBIN
-	do_elfio_glibc_backtrace(); // more useful backtrace
-#  else
-	do_basic_glibc_backtrace(); // only slightly useful backtrace
-#  endif // LL_ELFBIN
-}
-
 void LLAppViewerLinux::handleCrashReporting()
 {
+
 	// Always generate the report, have the logger do the asking, and
 	// don't wait for the logger before exiting (-> total cleanup).
 	if (CRASH_BEHAVIOR_NEVER_SEND != LLAppViewer::instance()->getCrashBehavior())
 	{	
+		// This backtrace writes into stack_trace.log
+#  if LL_ELFBIN
+		do_elfio_glibc_backtrace(); // more useful backtrace
+#  else
+		do_basic_glibc_backtrace(); // only slightly useful backtrace
+#  endif // LL_ELFBIN
 		// launch the actual crash logger
 		char* ask_dialog = "-dialog";
 		if (CRASH_BEHAVIOR_ASK != LLAppViewer::instance()->getCrashBehavior())
@@ -350,7 +329,6 @@ void LLAppViewerLinux::handleCrashReporting()
 			 (char*)"-name",
 			 (char*)LLAppViewer::instance()->getSecondLifeTitle().c_str(),
 			 NULL};
-		fflush(NULL);
 		pid_t pid = fork();
 		if (pid == 0)
 		{ // child
@@ -374,10 +352,9 @@ void LLAppViewerLinux::handleCrashReporting()
 			}
 		}
 	}
-	// Sometimes signals don't seem to quit the viewer.  Also, we may
-	// have been called explicitly instead of from a signal handler.
+	// Sometimes signals don't seem to quit the viewer.  
 	// Make sure we exit so as to not totally confuse the user.
-	_exit(1); // avoid atexit(), else we may re-crash in dtors.
+	exit(1);
 }
 
 bool LLAppViewerLinux::beingDebugged()
diff --git a/indra/newview/llappviewerlinux.h b/indra/newview/llappviewerlinux.h
index 300cb10e2d..ce91b6b8b6 100644
--- a/indra/newview/llappviewerlinux.h
+++ b/indra/newview/llappviewerlinux.h
@@ -54,7 +54,6 @@ protected:
 	virtual bool beingDebugged();
 
 	virtual void handleCrashReporting();
-	virtual void handleSyncCrashTrace();
 
 	virtual bool initLogging();
 	virtual bool initParseCommandLine(LLCommandLineParser& clp);
diff --git a/indra/newview/llappviewermacosx.cpp b/indra/newview/llappviewermacosx.cpp
index a748545a3b..1e4c08a1c1 100644
--- a/indra/newview/llappviewermacosx.cpp
+++ b/indra/newview/llappviewermacosx.cpp
@@ -160,11 +160,6 @@ bool LLAppViewerMacOSX::initParseCommandLine(LLCommandLineParser& clp)
     return true;
 }
 
-void LLAppViewerMacOSX::handleSyncCrashTrace()
-{
-	// do nothing
-}
-
 void LLAppViewerMacOSX::handleCrashReporting()
 {
 	// Macintosh
diff --git a/indra/newview/llappviewermacosx.h b/indra/newview/llappviewermacosx.h
index 644c2e0551..cc4a7f5eb5 100644
--- a/indra/newview/llappviewermacosx.h
+++ b/indra/newview/llappviewermacosx.h
@@ -50,10 +50,8 @@ public:
 
 protected:
 	virtual void handleCrashReporting(); 
-	virtual void handleSyncCrashTrace();
-
 	std::string generateSerialNumber();
-	virtual bool initParseCommandLine(LLCommandLineParser& clp);
+    virtual bool initParseCommandLine(LLCommandLineParser& clp);
 };
 
 #endif // LL_LLAPPVIEWERMACOSX_H
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index 3770fe2a33..143c9cece4 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -388,11 +388,6 @@ bool LLAppViewerWin32::initParseCommandLine(LLCommandLineParser& clp)
     return clp.parseCommandLineString(mCmdLine);
 }
 
-void LLAppViewerWin32::handleSyncCrashTrace()
-{
-	// do nothing
-}
-
 void LLAppViewerWin32::handleCrashReporting()
 {
 	// Windows only behaivor. Spawn win crash reporter.
diff --git a/indra/newview/llappviewerwin32.h b/indra/newview/llappviewerwin32.h
index d8a79a8b7a..66653c48f5 100644
--- a/indra/newview/llappviewerwin32.h
+++ b/indra/newview/llappviewerwin32.h
@@ -51,10 +51,9 @@ public:
 protected:
 	virtual void initConsole(); // Initialize OS level debugging console.
 	virtual bool initHardwareTest(); // Win32 uses DX9 to test hardware.
-	virtual bool initParseCommandLine(LLCommandLineParser& clp);
+    virtual bool initParseCommandLine(LLCommandLineParser& clp);
 
-	virtual void handleCrashReporting(); 
-	virtual void handleSyncCrashTrace();
+    virtual void handleCrashReporting(); 
 
 	std::string generateSerialNumber();
 
diff --git a/indra/newview/lldebugview.cpp b/indra/newview/lldebugview.cpp
index dc160a29ac..4aeb1d74bf 100644
--- a/indra/newview/lldebugview.cpp
+++ b/indra/newview/lldebugview.cpp
@@ -108,8 +108,9 @@ LLDebugView::LLDebugView(const std::string& name, const LLRect &rect)
 
 	mFloaterStatsp->setFollowsTop();
 	mFloaterStatsp->setFollowsRight();
-	// since this is a floater, it belongs to LLFloaterView
-	//addChild(mFloaterStatsp);
+	// Default to off
+	mFloaterStatsp->setVisible(FALSE);
+	addChild(mFloaterStatsp);
 
 	const S32 VELOCITY_LEFT = 10; // 370;
 	const S32 VELOCITY_WIDTH = 500;
diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp
index ab85a8c3c1..6bc14b331b 100644
--- a/indra/newview/llfloatercamera.cpp
+++ b/indra/newview/llfloatercamera.cpp
@@ -43,17 +43,21 @@
 // Constants
 const F32 CAMERA_BUTTON_DELAY = 0.0f;
 
+// Globals
+LLFloaterCamera* gFloaterCamera = NULL;
+
+
 //
 // Member functions
 //
 
-LLFloaterCamera::LLFloaterCamera(const LLSD& val)
-:	LLFloater("camera floater") // uses "FloaterCameraRect3"
+LLFloaterCamera::LLFloaterCamera(const std::string& name)
+:	LLFloater(name) // uses "FloaterCameraRect3"
 {
 	setIsChrome(TRUE);
 	
-	const BOOL DONT_OPEN = FALSE;
-	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml", NULL, DONT_OPEN);
+	// For now, only used for size and tooltip strings
+	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_camera.xml");
 	
 	S32 top = getRect().getHeight();
 	S32 bottom = 0;
@@ -99,12 +103,11 @@ LLFloaterCamera::LLFloaterCamera(const LLSD& val)
 	addChild(mTrack);
 }
 
-// virtual
-void LLFloaterCamera::onOpen()
+
+LLFloaterCamera::~LLFloaterCamera()
 {
-	LLFloater::onOpen();
-	
-	gSavedSettings.setBOOL("ShowCameraControls", TRUE);
+	// children all deleted by LLView destructor
+	gFloaterCamera = NULL;
 }
 
 // virtual
@@ -116,4 +119,45 @@ void LLFloaterCamera::onClose(bool app_quitting)
 	{
 		gSavedSettings.setBOOL("ShowCameraControls", FALSE);
 	}
-}
\ No newline at end of file
+}
+
+//
+// Static member functions
+//
+
+// static
+void LLFloaterCamera::show(void*)
+{
+	if(!gFloaterCamera)
+	{
+		gFloaterCamera = new LLFloaterCamera("camera floater");
+	}
+	gFloaterCamera->open();	/* Flawfinder: ignore */
+	gSavedSettings.setBOOL("ShowCameraControls", TRUE);
+}
+
+// static
+void LLFloaterCamera::toggle(void*)
+{
+	if (gFloaterCamera)
+	{
+		gFloaterCamera->close();
+	}
+	else
+	{
+		show(NULL);
+	}
+}
+
+// static
+BOOL LLFloaterCamera::visible(void*)
+{
+	if (gFloaterCamera)
+	{
+		return gFloaterCamera->getVisible();
+	}
+	else
+	{
+		return FALSE;
+	}
+}
diff --git a/indra/newview/llfloaterlagmeter.cpp b/indra/newview/llfloaterlagmeter.cpp
index b70ae9a227..1213d436cc 100644
--- a/indra/newview/llfloaterlagmeter.cpp
+++ b/indra/newview/llfloaterlagmeter.cpp
@@ -49,7 +49,9 @@ const LLString LAG_CRITICAL_IMAGE_NAME = "lag_status_critical.tga";
 const LLString LAG_WARNING_IMAGE_NAME  = "lag_status_warning.tga";
 const LLString LAG_GOOD_IMAGE_NAME     = "lag_status_good.tga";
 
-LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key)
+LLFloaterLagMeter * LLFloaterLagMeter::sInstance = NULL;
+
+LLFloaterLagMeter::LLFloaterLagMeter()
 	:	LLFloater("floater_lagmeter")
 {
 	LLUICtrlFactory::getInstance()->buildFloater(this, "floater_lagmeter.xml");
@@ -125,6 +127,8 @@ LLFloaterLagMeter::LLFloaterLagMeter(const LLSD& key)
 
 LLFloaterLagMeter::~LLFloaterLagMeter()
 {
+	sInstance = NULL;
+
 	// save shrunk status for next time
 	gSavedSettings.setBOOL("LagMeterShrunk", mShrunk);
 	// expand so we save the large window rectangle
@@ -143,6 +147,13 @@ void LLFloaterLagMeter::draw()
 	LLFloater::draw();
 }
 
+//static
+void LLFloaterLagMeter::show(void *data)
+{
+	if(!sInstance) sInstance = new LLFloaterLagMeter();
+	sInstance->open();
+}
+
 void LLFloaterLagMeter::determineClient()
 {
 	F32 client_frame_time = LLViewerStats::getInstance()->mFPSStat.getMeanDuration();
diff --git a/indra/newview/llfloaterlagmeter.h b/indra/newview/llfloaterlagmeter.h
index 6a034c840c..83603826c4 100644
--- a/indra/newview/llfloaterlagmeter.h
+++ b/indra/newview/llfloaterlagmeter.h
@@ -34,15 +34,14 @@
 
 #include "llfloater.h"
 
-class LLFloaterLagMeter : public LLFloater, public LLFloaterSingleton<LLFloaterLagMeter>
+class LLFloaterLagMeter : public LLFloater
 {
-	friend class LLUISingleton<LLFloaterLagMeter, VisibilityPolicy<LLFloater> >;
-	
 public:
 	/*virtual*/ void draw();
+	static void show(void*);
 
 private:
-	LLFloaterLagMeter(const LLSD& key);
+	LLFloaterLagMeter();
 	/*virtual*/ ~LLFloaterLagMeter();
 
 	void determineClient();
@@ -76,6 +75,8 @@ private:
 	LLTextBox * mServerCause;
 
 	LLString::format_map_t mStringArgs;
+
+	static LLFloaterLagMeter * sInstance;
 };
 
 #endif
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index e66d545409..1ad58f2706 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -192,10 +192,7 @@ LLPreferenceCore::LLPreferenceCore(LLTabContainer* tab_container, LLButton * def
 	mTabContainer->addTabPanel(mMsgPanel, mMsgPanel->getLabel(), FALSE, onTabChanged, mTabContainer);
 	mMsgPanel->setDefaultBtn(default_btn);
 
-	if (!mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
-	{
-		mTabContainer->selectFirstTab();
-	}
+	mTabContainer->selectTab(gSavedSettings.getS32("LastPrefTab"));
 }
 
 LLPreferenceCore::~LLPreferenceCore()
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 4819d5bd10..a73da0940e 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -52,18 +52,23 @@ const F32 MOVE_BUTTON_DELAY = 0.0f;
 const F32 YAW_NUDGE_RATE = 0.05f;	// fraction of normal speed
 const F32 NUDGE_TIME = 0.25f;		// in seconds
 
+//
+// Global statics
+//
+
+LLFloaterMove* LLFloaterMove::sInstance = NULL;
+
+
 //
 // Member functions
 //
 
 // protected
-LLFloaterMove::LLFloaterMove(const LLSD& key)
+LLFloaterMove::LLFloaterMove()
 :	LLFloater("move floater")
 {
 	setIsChrome(TRUE);
-
-	const BOOL DONT_OPEN = FALSE;
-	LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml", NULL, DONT_OPEN); 
+	LLUICtrlFactory::getInstance()->buildFloater(this,"floater_moveview.xml"); 
 
 	mForwardButton = getChild<LLJoystickAgentTurn>("forward btn"); 
 	mForwardButton->setHeldDownDelay(MOVE_BUTTON_DELAY);
@@ -94,6 +99,15 @@ LLFloaterMove::LLFloaterMove(const LLSD& key)
 	childSetAction("move down btn",moveDown,NULL);	
 	mMoveDownButton->setHeldDownDelay(MOVE_BUTTON_DELAY);
 	mMoveDownButton->setHeldDownCallback( moveDown );
+
+	sInstance = this;
+}
+
+// protected
+LLFloaterMove::~LLFloaterMove()
+{
+	// children all deleted by LLView destructor
+	sInstance = NULL;
 }
 
 // virtual
@@ -111,12 +125,42 @@ void LLFloaterMove::onClose(bool app_quitting)
 // Static member functions
 //
 
-void LLFloaterMove::onOpen()
+// static
+void LLFloaterMove::show(void*)
 {
-	LLFloater::onOpen();
+	if (sInstance)
+	{
+		sInstance->open();	/*Flawfinder: ignore*/
+	}
+	else
+	{
+		LLFloaterMove* f = new LLFloaterMove();
+		f->open();	/*Flawfinder: ignore*/
+	}
+	
 	gSavedSettings.setBOOL("ShowMovementControls", TRUE);
 }
 
+// static
+void LLFloaterMove::toggle(void*)
+{
+	if (sInstance)
+	{
+		sInstance->close();
+	}
+	else
+	{
+		show(NULL);
+	}
+}
+
+// static
+BOOL LLFloaterMove::visible(void*)
+{
+	return (sInstance != NULL);
+}
+
+
 // protected static 
 F32 LLFloaterMove::getYawRate( F32 time )
 {
@@ -134,14 +178,14 @@ F32 LLFloaterMove::getYawRate( F32 time )
 // protected static 
 void LLFloaterMove::turnLeft(void *)
 {
-	F32 time = getInstance()->mTurnLeftButton->getHeldDownTime();
+	F32 time = sInstance->mTurnLeftButton->getHeldDownTime();
 	gAgent.moveYaw( getYawRate( time ) );
 }
 
 // protected static 
 void LLFloaterMove::turnRight(void *)
 {
-	F32 time = getInstance()->mTurnRightButton->getHeldDownTime();
+	F32 time = sInstance->mTurnRightButton->getHeldDownTime();
 	gAgent.moveYaw( -getYawRate( time ) );
 }
 
diff --git a/indra/newview/llmoveview.h b/indra/newview/llmoveview.h
index 17005e0ded..4d55206194 100644
--- a/indra/newview/llmoveview.h
+++ b/indra/newview/llmoveview.h
@@ -43,21 +43,24 @@ class LLJoystickAgentSlide;
 // Classes
 //
 class LLFloaterMove
-:	public LLFloater, 
-	public LLFloaterSingleton<LLFloaterMove>
+:	public LLFloater
 {
-	friend class LLUISingleton<LLFloaterMove, VisibilityPolicy<LLFloater> >;
-	
 protected:
-	LLFloaterMove(const LLSD& key);
-	~LLFloaterMove() {}
+	LLFloaterMove();
+	~LLFloaterMove();
 
 public:
-	/*virtual*/ void onOpen();
 	/*virtual*/ void onClose(bool app_quitting);
 
 	static F32	getYawRate(F32 time);
 
+	static void show(void*);
+	static void toggle(void*);
+	static BOOL visible(void*);
+	
+	// This function is used for agent-driven button highlighting
+	static LLFloaterMove* getInstance()				{ return sInstance; }
+
 protected:
 	static void turnLeftNudge(void* userdata);
 	static void turnLeft(void* userdata);
@@ -77,6 +80,9 @@ public:
 	LLButton*				mTurnRightButton;
 	LLButton*				mMoveUpButton;
 	LLButton*				mMoveDownButton;
+
+protected:
+	static LLFloaterMove*	sInstance;
 };
 
 
diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp
index 1b2474728f..1550751e7f 100644
--- a/indra/newview/llnetmap.cpp
+++ b/indra/newview/llnetmap.cpp
@@ -436,12 +436,10 @@ void LLNetMap::draw()
 		}
 
 		// Draw dot for self avatar position
+		//drawTracking( gAgent.getPosGlobalFromAgent(gAgent.getFrameAgent().getCenter()), gSelfMapColor );
 		pos_global = gAgent.getPositionGlobal();
 		pos_map = globalPosToView(pos_global);
-		LLUIImagePtr you = LLWorldMapView::sAvatarYouSmallImage;
-		you->draw(
-			llround(pos_map.mV[VX]) - you->getWidth()/2, 
-			llround(pos_map.mV[VY]) - you->getHeight()/2);
+		LLWorldMapView::sAvatarYouSmallImage->draw(llround(pos_map.mV[VX]) - 4, llround(pos_map.mV[VY]) - 4);
 
 		// Draw frustum
 		F32 meters_to_pixels = gMiniMapScale/ LLWorld::getInstance()->getRegionWidthInMeters();
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index bcb2185687..669ea3167e 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -497,7 +497,7 @@ void LLTextureFetchWorker::setDesiredDiscard(S32 discard, S32 size)
 		mDesiredDiscard = discard;
 		mDesiredSize = size;
 	}
-	else if (size > mDesiredSize)
+	else if (size > mDesiredSize || size == 0)
 	{
 		mDesiredSize = size;
 		prioritize = true;
@@ -594,7 +594,8 @@ bool LLTextureFetchWorker::doWork(S32 param)
 			U32 cache_priority = mWorkPriority;
 			S32 offset = mFormattedImage.notNull() ? mFormattedImage->getDataSize() : 0;
 			S32 size = mDesiredSize - offset;
-			if (size <= 0)
+
+			if(mDesiredSize != 0 && size <= 0)
 			{
 				mState = CACHE_POST;
 				return false;
@@ -639,13 +640,12 @@ bool LLTextureFetchWorker::doWork(S32 param)
 
 	if (mState == CACHE_POST)
 	{
-		mDesiredSize = llmax(mDesiredSize, FIRST_PACKET_SIZE);
 		mCachedSize = mFormattedImage.notNull() ? mFormattedImage->getDataSize() : 0;
 		// Successfully loaded
 		if ((mCachedSize >= mDesiredSize) || mHaveAllData)
 		{
 			// we have enough data, decode it
-			llassert_always(mFormattedImage->getDataSize() > 0);
+			llassert_always(mFormattedImage.isNull() || mFormattedImage->getDataSize() > 0);
 			mState = DECODE_IMAGE;
 			// fall through
 		}
@@ -859,7 +859,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
 	
 	if (mState == DECODE_IMAGE)
 	{
-		llassert_always(mFormattedImage->getDataSize() > 0);
+		llassert_always(mFormattedImage.isNull() || mFormattedImage->getDataSize() > 0);
 		setPriority(LLWorkerThread::PRIORITY_LOW | mWorkPriority); // Set priority first since Responder may change it
 		mRawImage = NULL;
 		mAuxImage = NULL;
@@ -1311,13 +1311,13 @@ LLTextureFetch::~LLTextureFetch()
 }
 
 bool LLTextureFetch::createRequest(const LLUUID& id, const LLHost& host, F32 priority,
-									S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux)
+									S32 w, S32 h, S32 c, S32 discard, bool needs_aux)
 {
-	return createRequest(LLString::null, id, host, priority, w, h, c, desired_discard, needs_aux);
+	return createRequest(LLString::null, id, host, priority, w, h, c, discard, needs_aux);
 }
 
 bool LLTextureFetch::createRequest(const LLString& filename, const LLUUID& id, const LLHost& host, F32 priority,
-								   S32 w, S32 h, S32 c, S32 desired_discard, bool needs_aux)
+								   S32 w, S32 h, S32 c, S32 discard, bool needs_aux)
 {
 	if (mDebugPause)
 	{
@@ -1341,7 +1341,7 @@ bool LLTextureFetch::createRequest(const LLString& filename, const LLUUID& id, c
 	}
 
 	S32 desired_size;
-	if ((desired_discard == 0) && worker && worker->mFileSize)
+	if ((discard == 0) && worker && worker->mFileSize)
 	{
 		// if we want the entire image, and we know its size, then get it all
 		// (calcDataSizeJ2C() below makes assumptions about how the image
@@ -1349,25 +1349,24 @@ bool LLTextureFetch::createRequest(const LLString& filename, const LLUUID& id, c
 		// we really do get it.)
 		desired_size = worker->mFileSize;
 	}
+	//else if ((discard == 0) && worker == NULL)
+	//{
+	//	// if we want the entire image, but we don't know its size, then send
+	//	// a sentinel value of zero to request the entire contents of the cache.
+	//	// patch supplied by resident Sheet Spotter for VWR-2404
+	//	desired_size = 0;
+	//}
 	else if (w*h*c > 0)
 	{
 		// If the requester knows the dimentions of the image,
 		// this will calculate how much data we need without having to parse the header
 
-		desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, desired_discard);
+		desired_size = LLImageJ2C::calcDataSizeJ2C(w, h, c, discard);
 	}
 	else
 	{
-		if (desired_discard == 0)
-		{
-			// If we want all of the image, request the maximum possible data
-			desired_size = MAX_IMAGE_DATA_SIZE;
-		}
-		else
-		{
-			desired_size = FIRST_PACKET_SIZE;
-			desired_discard = MAX_DISCARD_LEVEL;
-		}
+		desired_size = FIRST_PACKET_SIZE;
+		discard = MAX_DISCARD_LEVEL;
 	}
 	if (worker)
 	{
@@ -1377,7 +1376,7 @@ bool LLTextureFetch::createRequest(const LLString& filename, const LLUUID& id, c
 		}
 		worker->lockWorkData();
 		worker->setImagePriority(priority);
-		worker->setDesiredDiscard(desired_discard, desired_size);
+		worker->setDesiredDiscard(discard, desired_size);
 		worker->unlockWorkData();
 		if (!worker->haveWork())
 		{
@@ -1390,18 +1389,18 @@ bool LLTextureFetch::createRequest(const LLString& filename, const LLUUID& id, c
 		if (filename.empty())
 		{
 			// do remote fetch
-			worker = new LLTextureFetchWorker(this, id, host, priority, desired_discard, desired_size);
+			worker = new LLTextureFetchWorker(this, id, host, priority, discard, desired_size);
 		}
 		else
 		{
 			// do local file fetch
-			worker = new LLTextureFetchLocalFileWorker(this, filename, id, host, priority, desired_discard, desired_size);
+			worker = new LLTextureFetchLocalFileWorker(this, filename, id, host, priority, discard, desired_size);
 		}
 		mRequestMap[id] = worker;
 	}
 	worker->mActiveCount++;
 	worker->mNeedsAux = needs_aux;
-// 	llinfos << "REQUESTED: " << id << " Discard: " << desired_discard << llendl;
+// 	llinfos << "REQUESTED: " << id << " Discard: " << discard << llendl;
 	return true;
 }
 
diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h
index 0b0fafecc5..64090d24e6 100644
--- a/indra/newview/llvieweraudio.h
+++ b/indra/newview/llvieweraudio.h
@@ -32,12 +32,6 @@
 #ifndef LL_VIEWERAUDIO_H
 #define LL_VIEWERAUDIO_H
 
-// comment out to turn off wind
-#define kAUDIO_ENABLE_WIND 
-//#define kAUDIO_ENABLE_WATER 1	// comment out to turn off water
-#define kAUDIO_NUM_BUFFERS 30
-#define kAUDIO_NUM_SOURCES 30 
-
 void init_audio();
 void audio_update_volume(bool force_update = true);
 void audio_update_listener();
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index ac361fa80b..ec52118098 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -5360,11 +5360,11 @@ class LLShowFloater : public view_listener_t
 		}
 		else if (floater_name == "camera controls")
 		{
-			LLFloaterCamera::toggleInstance();
+			LLFloaterCamera::toggle(NULL);
 		}
 		else if (floater_name == "movement controls")
 		{
-			LLFloaterMove::toggleInstance();
+			LLFloaterMove::show(NULL);
 		}
 		else if (floater_name == "world map")
 		{
@@ -5435,7 +5435,7 @@ class LLShowFloater : public view_listener_t
 		}
 		else if (floater_name == "lag meter")
 		{
-			LLFloaterLagMeter::showInstance();
+			LLFloaterLagMeter::show(NULL);
 		}
 		else if (floater_name == "bug reporter")
 		{
@@ -5488,11 +5488,11 @@ class LLFloaterVisible : public view_listener_t
 		}
 		else if (floater_name == "camera controls")
 		{
-			new_value = LLFloaterCamera::instanceVisible();
+			new_value = LLFloaterCamera::visible(NULL);
 		}
 		else if (floater_name == "movement controls")
 		{
-			new_value = LLFloaterMove::instanceVisible();
+			new_value = LLFloaterMove::visible(NULL);
 		}
 		else if (floater_name == "stat bar")
 		{
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 99f1af61e5..439063e439 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -36,6 +36,7 @@
 #include <deque>
 
 #include "audioengine.h" 
+#include "audiosettings.h"
 #include "indra_constants.h"
 #include "lscript_byteformat.h"
 #include "mean_collision_data.h"
@@ -67,7 +68,6 @@
 #include "llagent.h"
 #include "llcallingcard.h"
 #include "llconsole.h"
-#include "llvieweraudio.h"
 #include "llviewercontrol.h"
 #include "lldrawpool.h"
 #include "llfirstuse.h"
@@ -4069,7 +4069,7 @@ void process_alert_core(const std::string& message, BOOL modal)
 		LLString snap_filename = gDirUtilp->getLindenUserDir();
 		snap_filename += gDirUtilp->getDirDelimiter();
 		snap_filename += SCREEN_HOME_FILENAME;
-		gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowDisplayWidth(), gViewerWindow->getWindowDisplayHeight(), FALSE, FALSE);
+		gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidth(), gViewerWindow->getWindowHeight(), FALSE, FALSE);
 	}
 
 	const std::string ALERT_PREFIX("ALERT: ");
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 52b10a2fd9..696a2ad3c6 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1992,6 +1992,7 @@ LLViewerWindow::~LLViewerWindow()
 	// Automatically deleted as children of mRootView.  Fix the globals.
 	gFloaterTools = NULL;
 	gStatusBar = NULL;
+	gFloaterCamera = NULL;
 	gIMMgr = NULL;
 	gHoverView = NULL;
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index ce4a660682..2b8cf93b2d 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -741,23 +741,7 @@ void LLVOVolume::sculpt()
 
 		
 		S32 current_discard = getVolume()->getSculptLevel();
-		if(current_discard < -2)
-		{
-			llwarns << "WARNING!!: Current discard of sculpty at " << current_discard 
-				<< " is less than -2." << llendl;
-			
-			// corrupted volume... don't update the sculpty
-			return;
-		}
-		else if (current_discard > max_discard)
-		{
-			llwarns << "WARNING!!: Current discard of sculpty at " << current_discard 
-				<< " is more than than allowed max of " << max_discard << llendl;
-			
-			// corrupted volume... don't update the sculpty			
-			return;
-		}
-
+		llassert_always(current_discard >= -2 && current_discard <= max_discard);
 		if (current_discard == discard_level)  // no work to do here
 			return;
 		
diff --git a/indra/newview/llworld.cpp b/indra/newview/llworld.cpp
index e45b929b6f..ca947bed97 100644
--- a/indra/newview/llworld.cpp
+++ b/indra/newview/llworld.cpp
@@ -118,11 +118,7 @@ LLWorld::LLWorld()
 void LLWorld::destroyClass()
 {
 	gObjectList.destroy();
-	for(region_list_t::iterator region_it = mRegionList.begin(); region_it != mRegionList.end(); )
-	{
-		LLViewerRegion* region_to_delete = *region_it++;
-		removeRegion(region_to_delete->getHost());
-	}
+	for_each(mRegionList.begin(), mRegionList.end(), DeletePointer());
 	LLViewerPartSim::getInstance()->destroyClass();
 }
 
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index b147b471fa..edb7002584 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -116,7 +116,7 @@ class ViewerManifest(LLManifest):
                         if self.default_channel():
                                 # beta grid viewer
                                 channel_flags = '--settings settings_beta.xml'
-                        grid_flags = "--grid %(grid)s --helperuri http://preview-%(grid)s.secondlife.com/helpers/" % {'grid':self.args['grid']}
+                        grid_flags = "--helperuri http://preview-%(grid)s.secondlife.com/helpers/ --loginuri https://login.%(grid)s.lindenlab.com/cgi-bin/login.cgi" % {'grid':self.args['grid']}
                         
                 if not self.default_channel():
                         # some channel on some grid
@@ -438,7 +438,7 @@ class LinuxManifest(ViewerManifest):
         def construct(self):
                 super(LinuxManifest, self).construct()
                 self.path("licenses-linux.txt","licenses.txt")
-                self.path("res/ll_icon.png","secondlife_icon.png")
+                #self.path("res/ll_icon.ico","secondlife.ico")
                 if self.prefix("linux_tools", ""):
                         self.path("client-readme.txt","README-linux.txt")
                         self.path("client-readme-voice.txt","README-linux-voice.txt")
-- 
cgit v1.2.3