diff --git a/autobuild.xml b/autobuild.xml
index 283eeabbeb5572ed9121deb7637d33beaf284184..51515b36962cd0b11aba89e1115dd585a1409573 100644
--- a/autobuild.xml
+++ b/autobuild.xml
@@ -166,9 +166,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>c68630bd937509573df87a41452bc464</string>
+              <string>3cc73623c9a976b4f8346a3837f7a916</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56315/526789/boost-1.72-darwin64-539869.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64088/601256/boost-1.72-darwin64-545361.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -202,9 +202,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>097d04c5b064c4be4bc9edb885509a94</string>
+              <string>7d4b2511976449e9a4ec7be41dc8310f</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56321/526797/boost-1.72-windows-539869.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64092/601270/boost-1.72-windows-545361.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
@@ -214,9 +214,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>748c4d47cced7ba2b210eb6d0ed33497</string>
+              <string>4ad8df0700745201cddf6b71d7b0949f</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56320/526777/boost-1.72-windows64-539869.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64091/601265/boost-1.72-windows64-545361.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows64</string>
@@ -308,9 +308,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>76e70d1f024e089bcd1afa6748d67a62</string>
+              <string>02e6a8207dcdaf243dcb6da19b8c3534</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56409/527191/colladadom-2.3.539922-darwin64-539922.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64099/601302/colladadom-2.3.545362-darwin64-545362.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -344,9 +344,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>3d6ab0e5e08a7f03088232e5676a861e</string>
+              <string>8a02a10fc69c8f504dc5335644db184a</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56415/527297/colladadom-2.3.539922-windows-539922.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64104/601313/colladadom-2.3.545362-windows-545362.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
@@ -356,16 +356,16 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>5a31c4d50a04d255e84903f16597d4ed</string>
+              <string>742180324fca7ab92b6a61a36aab4f9d</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56408/527200/colladadom-2.3.539922-windows64-539922.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64103/601314/colladadom-2.3.545362-windows64-545362.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows64</string>
           </map>
         </map>
         <key>version</key>
-        <string>2.3.539922</string>
+        <string>2.3.545362</string>
       </map>
       <key>curl</key>
       <map>
@@ -398,9 +398,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>decf3d5bd930e9ac6113cf96c61ff230</string>
+              <string>f5ae57117a6518d11f49ccfbfbe0969d</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56342/526921/curl-7.54.1.539883-darwin64-539883.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64131/601402/curl-7.54.1.545369-darwin64-545369.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -434,11 +434,11 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>ebd24261499e458da253d2bc1d95057a</string>
+              <string>2796ae7b09e730a55ac03f74ed669520</string>
               <key>hash_algorithm</key>
               <string>md5</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56361/526996/curl-7.54.1.539883-windows-539883.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64130/601396/curl-7.54.1.545369-windows-545369.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
@@ -448,16 +448,16 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>9eadfc1885c59ebc750f75adf4c20925</string>
+              <string>a8f96e5cdb8128b23d49ff4c3f2233a4</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56360/526989/curl-7.54.1.539883-windows64-539883.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64129/601382/curl-7.54.1.545369-windows64-545369.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows64</string>
           </map>
         </map>
         <key>version</key>
-        <string>7.54.1.539883</string>
+        <string>7.54.1.545369</string>
       </map>
       <key>db</key>
       <map>
@@ -1262,9 +1262,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>36e2e30610eb131e3522ef84cc67405d</string>
+              <string>f9831360ced94943ab9dfb3fbf5256d3</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56330/526832/googlemock-1.7.0.539876-darwin64-539876.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64101/601290/googlemock-1.7.0.545363-darwin64-545363.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -1298,9 +1298,9 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>38a2c655876044efe536a8e685e74a2a</string>
+              <string>8149e46b4f7abb3ac284415cfe1366e1</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56336/526861/googlemock-1.7.0.539876-windows-539876.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64102/601296/googlemock-1.7.0.545363-windows-545363.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
@@ -1310,16 +1310,16 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>ff4fa1fd7a1ed9ffa477c4574ffc16af</string>
+              <string>f3851eba809ead2810d702041569d36d</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/56334/526845/googlemock-1.7.0.539876-windows64-539876.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64100/601284/googlemock-1.7.0.545363-windows64-545363.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows64</string>
           </map>
         </map>
         <key>version</key>
-        <string>1.7.0.539876</string>
+        <string>1.7.0.545363</string>
       </map>
       <key>gstreamer</key>
       <map>
@@ -2187,16 +2187,16 @@
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>3d2122c39abb8bc6f46c0ddc0838ab2a</string>
+              <string>8501cbaa7e0f254614694da784a9c61c</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/58176/544556/llca-202004280657.541101-common-541101.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64944/606925/llca-202008010216.546021-common-546021.tar.bz2</string>
             </map>
             <key>name</key>
             <string>common</string>
           </map>
         </map>
         <key>version</key>
-        <string>202004280657.541101</string>
+        <string>202008010216.546021</string>
       </map>
       <key>llphysicsextensions_source</key>
       <map>
@@ -2412,9 +2412,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>95b69e37b9b4435698682f4ff702cca5</string>
+              <string>937ce1a2158c0cfff37f5989f5b24aba</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/54855/510169/nghttp2-1.25.0.538985-darwin64-538985.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64066/601156/nghttp2-1.40.0.545354-darwin64-545354.tar.bz2</string>
             </map>
             <key>name</key>
             <string>darwin64</string>
@@ -2448,9 +2448,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>246dd8445be87c698aa7fa318bcdd7e5</string>
+              <string>138b881bdf37dff4e626e022a50dd11f</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/55035/511985/nghttp2-1.25.0.538985-windows-538985.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64069/601181/nghttp2-1.40.0.545354-windows-545354.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows</string>
@@ -2460,9 +2460,9 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
             <key>archive</key>
             <map>
               <key>hash</key>
-              <string>f2fd2dbe8704ec63ab433cbe8e03f7c4</string>
+              <string>c23c6480c7cbea60a2bd26e257adc0a7</string>
               <key>url</key>
-              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/55031/511978/nghttp2-1.25.0.538985-windows64-538985.tar.bz2</string>
+              <string>http://automated-builds-secondlife-com.s3.amazonaws.com/ct2/64068/601177/nghttp2-1.40.0.545354-windows64-545354.tar.bz2</string>
             </map>
             <key>name</key>
             <string>windows64</string>
@@ -2471,7 +2471,7 @@ Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors</string>
         <key>source_type</key>
         <string>hg</string>
         <key>version</key>
-        <string>1.25.0.538985</string>
+        <string>1.40.0.545354</string>
       </map>
       <key>nvapi</key>
       <map>
diff --git a/doc/contributions.txt b/doc/contributions.txt
index 7bbbf6430a52d84a7c080bc372caf750f71742e3..4d8165faf2e7aa99161d96fe2351b99565df5ba7 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -1086,6 +1086,8 @@ Nicky Dasmijn
 	SL-10293
 	SL-11061
     SL-11072
+	SL-13141
+	SL-13642
 Nicky Perian
 	OPEN-1
 	STORM-1087
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 7f84ec146aeed67a5714e07b69d380907c65c0e6..429bda473b00d8b92b7aef31dad6708d35d3d1ab 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -160,7 +160,7 @@ elseif(DARWIN)
         libndofdev.dylib
         libnghttp2.dylib
         libnghttp2.14.dylib
-        libnghttp2.14.14.0.dylib
+        libnghttp2.14.19.0.dylib
        )
 
     if (FMODSTUDIO)
diff --git a/indra/llcommon/llapr.cpp b/indra/llcommon/llapr.cpp
index 29f0c7da9a39ee1ac9d6906a51519cf621dc44a3..984e90f37627116b3f7eb9f2b7ad132c280d830a 100644
--- a/indra/llcommon/llapr.cpp
+++ b/indra/llcommon/llapr.cpp
@@ -240,6 +240,64 @@ void _ll_apr_assert_status(apr_status_t status, const char* file, int line)
 	llassert(! _ll_apr_warn_status(status, file, line));
 }
 
+//---------------------------------------------------------------------
+//
+// Scope based pool access
+//
+//---------------------------------------------------------------------
+
+class LLAPRFilePoolScope
+{
+public:
+    LLAPRFilePoolScope() : pPool(NULL), mInitialized(false) {}
+    LLAPRFilePoolScope(LLVolatileAPRPool* poolp) : mInitialized(false)
+    { 
+        setFilePool(poolp);
+    }
+    ~LLAPRFilePoolScope()
+    {
+        reset();
+    }
+    apr_pool_t* getVolatileAPRPool(LLVolatileAPRPool* poolp = NULL)
+    {
+        if (!pPool)
+        {
+            setFilePool(poolp);
+        }
+        if (mInitialized)
+        {
+            // We need one clear per one get
+            // At the moment no need to support multiple calls
+            LL_ERRS() << "LLAPRFilePoolScope is not supposed to be initialized twice" << LL_ENDL;
+        }
+        mInitialized = true;
+        return pPool->getVolatileAPRPool();
+    }
+    void reset()
+    {
+        if (mInitialized)
+        {
+            pPool->clearVolatileAPRPool();
+        }
+    }
+
+private:
+    void setFilePool(LLVolatileAPRPool* poolp = NULL)
+    {
+        if (poolp)
+        {
+            pPool = poolp;
+        }
+        else
+        {
+            pPool = LLAPRFile::sAPRFilePoolp;
+        }
+    }
+
+    LLVolatileAPRPool *pPool;
+    bool mInitialized;
+};
+
 //---------------------------------------------------------------------
 //
 // LLAPRFile functions
@@ -287,9 +345,10 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, LLV
 	//check if already open some file
 	llassert_always(!mFile) ;
 	llassert_always(!mCurrentFilePoolp) ;
-	
-	apr_pool_t* apr_pool = pool ? pool->getVolatileAPRPool() : NULL ;
-	s = apr_file_open(&mFile, filename.c_str(), flags, APR_OS_DEFAULT, getAPRFilePool(apr_pool));
+
+	mCurrentFilePoolp = pool ? pool : sAPRFilePoolp;
+	apr_pool_t* apr_pool = mCurrentFilePoolp->getVolatileAPRPool(); //paired with clear in close()
+	s = apr_file_open(&mFile, filename.c_str(), flags, APR_OS_DEFAULT, apr_pool);
 
 	if (s != APR_SUCCESS || !mFile)
 	{
@@ -314,14 +373,10 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, LLV
 		*sizep = file_size;
 	}
 
-	if(!mCurrentFilePoolp)
+	if (!mFile)
 	{
-		mCurrentFilePoolp = pool ;
-
-		if(!mFile)
-		{
-			close() ;
-		}
+		// It will clean pool
+		close() ;
 	}
 
 	return s ;
@@ -348,17 +403,6 @@ apr_status_t LLAPRFile::open(const std::string& filename, apr_int32_t flags, BOO
 	return s;
 }
 
-apr_pool_t* LLAPRFile::getAPRFilePool(apr_pool_t* pool)
-{	
-	if(!pool)
-	{
-		mCurrentFilePoolp = sAPRFilePoolp ;
-		return mCurrentFilePoolp->getVolatileAPRPool() ;
-	}
-
-	return pool ;
-}
-
 // File I/O
 S32 LLAPRFile::read(void *buf, S32 nbytes)
 {
@@ -415,7 +459,7 @@ S32 LLAPRFile::seek(apr_seek_where_t where, S32 offset)
 //
 
 //static
-apr_status_t LLAPRFile::close(apr_file_t* file_handle, LLVolatileAPRPool* pool) 
+apr_status_t LLAPRFile::close(apr_file_t* file_handle) 
 {
 	apr_status_t ret = APR_SUCCESS ;
 	if(file_handle)
@@ -424,29 +468,23 @@ apr_status_t LLAPRFile::close(apr_file_t* file_handle, LLVolatileAPRPool* pool)
 		file_handle = NULL ;
 	}
 
-	if(pool)
-	{
-		pool->clearVolatileAPRPool() ;
-	}
-
 	return ret ;
 }
 
 //static
-apr_file_t* LLAPRFile::open(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags)
+apr_file_t* LLAPRFile::open(const std::string& filename, apr_pool_t* apr_pool, apr_int32_t flags)
 {
 	apr_status_t s;
 	apr_file_t* file_handle ;
 
-	pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
 
-	s = apr_file_open(&file_handle, filename.c_str(), flags, APR_OS_DEFAULT, pool->getVolatileAPRPool());
+	s = apr_file_open(&file_handle, filename.c_str(), flags, APR_OS_DEFAULT, apr_pool);
 	if (s != APR_SUCCESS || !file_handle)
 	{
 		ll_apr_warn_status(s);
 		LL_WARNS("APR") << " Attempting to open filename: " << filename << LL_ENDL;
 		file_handle = NULL ;
-		close(file_handle, pool) ;
+		close(file_handle) ;
 		return NULL;
 	}
 
@@ -489,8 +527,9 @@ S32 LLAPRFile::seek(apr_file_t* file_handle, apr_seek_where_t where, S32 offset)
 S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nbytes, LLVolatileAPRPool* pool)
 {
 	//*****************************************
-	apr_file_t* file_handle = open(filename, pool, APR_READ|APR_BINARY); 
-	//*****************************************	
+	LLAPRFilePoolScope scope(pool);
+	apr_file_t* file_handle = open(filename, scope.getVolatileAPRPool(), APR_READ|APR_BINARY); 
+	//*****************************************
 	if (!file_handle)
 	{
 		return 0;
@@ -523,7 +562,7 @@ S32 LLAPRFile::readEx(const std::string& filename, void *buf, S32 offset, S32 nb
 	}
 	
 	//*****************************************
-	close(file_handle, pool) ; 
+	close(file_handle) ; 
 	//*****************************************
 	return (S32)bytes_read;
 }
@@ -537,9 +576,10 @@ S32 LLAPRFile::writeEx(const std::string& filename, void *buf, S32 offset, S32 n
 		flags |= APR_APPEND;
 		offset = 0;
 	}
-	
+
 	//*****************************************
-	apr_file_t* file_handle = open(filename, pool, flags);
+	LLAPRFilePoolScope scope(pool);
+	apr_file_t* file_handle = open(filename, scope.getVolatileAPRPool(), flags);
 	//*****************************************
 	if (!file_handle)
 	{
@@ -573,7 +613,7 @@ S32 LLAPRFile::writeEx(const std::string& filename, void *buf, S32 offset, S32 n
 	}
 
 	//*****************************************
-	LLAPRFile::close(file_handle, pool);
+	LLAPRFile::close(file_handle);
 	//*****************************************
 
 	return (S32)bytes_written;
@@ -584,9 +624,8 @@ bool LLAPRFile::remove(const std::string& filename, LLVolatileAPRPool* pool)
 {
 	apr_status_t s;
 
-	pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
-	s = apr_file_remove(filename.c_str(), pool->getVolatileAPRPool());
-	pool->clearVolatileAPRPool() ;
+	LLAPRFilePoolScope scope(pool);
+	s = apr_file_remove(filename.c_str(), scope.getVolatileAPRPool());
 
 	if (s != APR_SUCCESS)
 	{
@@ -602,9 +641,8 @@ bool LLAPRFile::rename(const std::string& filename, const std::string& newname,
 {
 	apr_status_t s;
 
-	pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
-	s = apr_file_rename(filename.c_str(), newname.c_str(), pool->getVolatileAPRPool());
-	pool->clearVolatileAPRPool() ;
+	LLAPRFilePoolScope scope(pool);
+	s = apr_file_rename(filename.c_str(), newname.c_str(), scope.getVolatileAPRPool());
 	
 	if (s != APR_SUCCESS)
 	{
@@ -621,18 +659,16 @@ bool LLAPRFile::isExist(const std::string& filename, LLVolatileAPRPool* pool, ap
 	apr_file_t* apr_file;
 	apr_status_t s;
 
-	pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
-	s = apr_file_open(&apr_file, filename.c_str(), flags, APR_OS_DEFAULT, pool->getVolatileAPRPool());	
+	LLAPRFilePoolScope scope(pool);
+	s = apr_file_open(&apr_file, filename.c_str(), flags, APR_OS_DEFAULT, scope.getVolatileAPRPool());	
 
 	if (s != APR_SUCCESS || !apr_file)
 	{
-		pool->clearVolatileAPRPool() ;
 		return false;
 	}
 	else
 	{
 		apr_file_close(apr_file) ;
-		pool->clearVolatileAPRPool() ;
 		return true;
 	}
 }
@@ -643,14 +679,12 @@ S32 LLAPRFile::size(const std::string& filename, LLVolatileAPRPool* pool)
 	apr_file_t* apr_file;
 	apr_finfo_t info;
 	apr_status_t s;
-	
-	pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
-	s = apr_file_open(&apr_file, filename.c_str(), APR_READ, APR_OS_DEFAULT, pool->getVolatileAPRPool());
+
+	LLAPRFilePoolScope scope(pool);
+	s = apr_file_open(&apr_file, filename.c_str(), APR_READ, APR_OS_DEFAULT, scope.getVolatileAPRPool());
 	
 	if (s != APR_SUCCESS || !apr_file)
-	{		
-		pool->clearVolatileAPRPool() ;
-		
+	{				
 		return 0;
 	}
 	else
@@ -658,7 +692,6 @@ S32 LLAPRFile::size(const std::string& filename, LLVolatileAPRPool* pool)
 		apr_status_t s = apr_file_info_get(&info, APR_FINFO_SIZE, apr_file);		
 
 		apr_file_close(apr_file) ;
-		pool->clearVolatileAPRPool() ;
 		
 		if (s == APR_SUCCESS)
 		{
@@ -676,9 +709,8 @@ bool LLAPRFile::makeDir(const std::string& dirname, LLVolatileAPRPool* pool)
 {
 	apr_status_t s;
 
-	pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
-	s = apr_dir_make(dirname.c_str(), APR_FPROT_OS_DEFAULT, pool->getVolatileAPRPool());
-	pool->clearVolatileAPRPool() ;
+	LLAPRFilePoolScope scope(pool);
+	s = apr_dir_make(dirname.c_str(), APR_FPROT_OS_DEFAULT, scope.getVolatileAPRPool());
 		
 	if (s != APR_SUCCESS)
 	{
@@ -694,9 +726,8 @@ bool LLAPRFile::removeDir(const std::string& dirname, LLVolatileAPRPool* pool)
 {
 	apr_status_t s;
 
-	pool = pool ? pool : LLAPRFile::sAPRFilePoolp ;
-	s = apr_file_remove(dirname.c_str(), pool->getVolatileAPRPool());
-	pool->clearVolatileAPRPool() ;
+	LLAPRFilePoolScope scope(pool);
+	s = apr_file_remove(dirname.c_str(), scope.getVolatileAPRPool());
 	
 	if (s != APR_SUCCESS)
 	{
diff --git a/indra/llcommon/llapr.h b/indra/llcommon/llapr.h
index 3c07976f426ac898052ce1cd5ee5ae64ee64176d..255b50c8d04516d3e3da19c77c2dd4766346639a 100644
--- a/indra/llcommon/llapr.h
+++ b/indra/llcommon/llapr.h
@@ -170,9 +170,6 @@ class LL_COMMON_API LLAPRFile : boost::noncopyable
 	S32 write(const void* buf, S32 nbytes);
 	
 	apr_file_t* getFileHandle() {return mFile;}	
-
-private:
-	apr_pool_t* getAPRFilePool(apr_pool_t* pool) ;	
 	
 //
 //*******************************************************************************************************************************
@@ -182,8 +179,8 @@ class LL_COMMON_API LLAPRFile : boost::noncopyable
 	static LLVolatileAPRPool *sAPRFilePoolp ; //a global apr_pool for APRFile, which is used only when local pool does not exist.
 
 private:
-	static apr_file_t* open(const std::string& filename, LLVolatileAPRPool* pool, apr_int32_t flags);
-	static apr_status_t close(apr_file_t* file, LLVolatileAPRPool* pool) ;
+	static apr_file_t* open(const std::string& filename, apr_pool_t* apr_pool, apr_int32_t flags);
+	static apr_status_t close(apr_file_t* file) ;
 	static S32 seek(apr_file_t* file, apr_seek_where_t where, S32 offset);
 public:
 	// returns false if failure:
diff --git a/indra/llcommon/llsdutil.cpp b/indra/llcommon/llsdutil.cpp
index d44387cc55c892d25bd674536dd39da6d02e1048..3f3edb661fdc1183d91f3e7e21cfefca93d6e300 100644
--- a/indra/llcommon/llsdutil.cpp
+++ b/indra/llcommon/llsdutil.cpp
@@ -506,7 +506,7 @@ struct Data
     const char* name;
 } typedata[] =
 {
-#define def(type) { LLSD::type, #type + 4 }
+#define def(type) { LLSD::type, &#type[4] }
     def(TypeUndefined),
     def(TypeBoolean),
     def(TypeInteger),
diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h
index 84be95ba5499e9bbf98526565d137b3061467761..8678ca97f2e9ac7b75c0f468af9bf5c90b44f8cc 100644
--- a/indra/llcommon/llsdutil.h
+++ b/indra/llcommon/llsdutil.h
@@ -558,9 +558,11 @@ LLSD shallow(LLSD value, LLSD filter=LLSD()) { return llsd_shallow(value, filter
 
 } // namespace llsd
 
-// Specialization for generating a hash value from an LLSD block. 
+// Specialization for generating a hash value from an LLSD block.
+namespace boost
+{
 template <>
-struct boost::hash<LLSD>
+struct hash<LLSD>
 {
     typedef LLSD argument_type;
     typedef std::size_t result_type;
@@ -621,5 +623,5 @@ struct boost::hash<LLSD>
         return seed;
     }
 };
-
+}
 #endif // LL_LLSDUTIL_H
diff --git a/indra/llcommon/llstl.h b/indra/llcommon/llstl.h
index b024b47225a873814b081e773fa8e5c5efb1c829..a90c2c7e087a0593f1194662eff34b15c841aaef 100644
--- a/indra/llcommon/llstl.h
+++ b/indra/llcommon/llstl.h
@@ -36,6 +36,10 @@
 #include <set>
 #include <typeinfo>
 
+#ifdef LL_LINUX
+// <ND> For strcmp
+#include <string.h>
+#endif
 // Use to compare the first element only of a pair
 // e.g. typedef std::set<std::pair<int, Data*>, compare_pair<int, Data*> > some_pair_set_t; 
 template <typename T1, typename T2>
diff --git a/indra/llcommon/llthreadsafequeue.h b/indra/llcommon/llthreadsafequeue.h
index 30dd507f73acac5aaa29c8c9fa30f80d5921e6ca..26e0d71d314341c4abf3b47231a12dfa3854dd96 100644
--- a/indra/llcommon/llthreadsafequeue.h
+++ b/indra/llcommon/llthreadsafequeue.h
@@ -304,14 +304,13 @@ template<typename ElementT>
 bool LLThreadSafeQueue<ElementT>::isClosed()
 {
     lock_t lock(mLock);
-    return mClosed;
+    return mClosed && mStorage.size() == 0;
 }
 
 template<typename ElementT>
 LLThreadSafeQueue<ElementT>::operator bool()
 {
-    lock_t lock(mLock);
-    return ! mClosed;
+    return ! isClosed();
 }
 
 #endif
diff --git a/indra/llkdu/include_kdu_xxxx.h b/indra/llkdu/include_kdu_xxxx.h
index a1dbced60b27b128dab55bdaeff52158f74dd03e..61204b568934da6827b4b7acf2e8f4c3af2299e7 100644
--- a/indra/llkdu/include_kdu_xxxx.h
+++ b/indra/llkdu/include_kdu_xxxx.h
@@ -16,7 +16,7 @@
 // #include "include_kdu_xxxx.h"
 // // kdu_xxxx #undef'ed by include_kdu_xxxx.h
 
-#if LL_DARWIN
+#if __clang__
 // don't *really* want to rebuild KDU so turn off specific warnings for this header
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wself-assign-field"
diff --git a/indra/llkdu/tests/llimagej2ckdu_test.cpp b/indra/llkdu/tests/llimagej2ckdu_test.cpp
index 79ed566d00ddaa0466e6e5a93169f610d64c8e55..ee7b14be853a7054ae0bb29c226053174541e12a 100644
--- a/indra/llkdu/tests/llimagej2ckdu_test.cpp
+++ b/indra/llkdu/tests/llimagej2ckdu_test.cpp
@@ -29,7 +29,7 @@
 // Class to test 
 #include "llimagej2ckdu.h"
 
-#if LL_DARWIN
+#if __clang__
 // For this source, it's true that private fields in llkdumem.h are unused.
 #pragma clang diagnostic push
 #pragma clang diagnostic ignored "-Wunused-private-field"
diff --git a/indra/llmessage/llassetstorage.cpp b/indra/llmessage/llassetstorage.cpp
index 18b2b124e1aad446ec86c68eecf30a1fca266257..d7801b6ddc16f86bbf7620fffb698f626641dbb8 100644
--- a/indra/llmessage/llassetstorage.cpp
+++ b/indra/llmessage/llassetstorage.cpp
@@ -426,11 +426,11 @@ void LLAssetStorage::_cleanupRequests(BOOL all, S32 error)
         LLAssetRequest* tmp = *curiter;
         if (tmp->mUpCallback)
         {
-            tmp->mUpCallback(tmp->getUUID(), tmp->mUserData, error, LL_EXSTAT_NONE);
+            tmp->mUpCallback(tmp->getUUID(), tmp->mUserData, error, LLExtStat::NONE);
         }
         if (tmp->mDownCallback)
         {
-            tmp->mDownCallback(mVFS, tmp->getUUID(), tmp->getType(), tmp->mUserData, error, LL_EXSTAT_NONE);
+            tmp->mDownCallback(mVFS, tmp->getUUID(), tmp->getType(), tmp->mUserData, error, LLExtStat::NONE);
         }
         if (tmp->mInfoCallback)
         {
@@ -465,7 +465,7 @@ bool LLAssetStorage::findInStaticVFSAndInvokeCallback(const LLUUID& uuid, LLAsse
             // we've already got the file
             if (callback)
             {
-                callback(mStaticVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
+                callback(mStaticVFS, uuid, type, user_data, LL_ERR_NOERR, LLExtStat::VFS_CACHED);
             }
             return true;
         }
@@ -506,7 +506,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
         if (callback)
         {
             add(sFailedDownloadCount, 1);
-            callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_NONE);
+            callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_FAILED, LLExtStat::NONE);
         }
         return;
     }
@@ -517,7 +517,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
         if (callback)
         {
             add(sFailedDownloadCount, 1);
-            callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
+            callback(mVFS, uuid, type, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LLExtStat::NULL_UUID);
         }
         return;
     }
@@ -540,7 +540,7 @@ void LLAssetStorage::getAssetData(const LLUUID uuid,
         // unless there's a weird error
         if (callback)
         {
-            callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
+            callback(mVFS, uuid, type, user_data, LL_ERR_NOERR, LLExtStat::VFS_CACHED);
         }
 
         LL_DEBUGS("AssetStorage") << "ASSET_TRACE asset " << uuid << " found in VFS" << LL_ENDL;
@@ -694,7 +694,7 @@ void LLAssetStorage::downloadCompleteCallback(
         }
     }
 
-    removeAndCallbackPendingDownloads(file_id, file_type, callback_id, callback_type, ext_status, result);
+    removeAndCallbackPendingDownloads(file_id, file_type, callback_id, callback_type, result, ext_status);
 }
 
 void LLAssetStorage::getEstateAsset(
@@ -719,7 +719,7 @@ void LLAssetStorage::getEstateAsset(
         if (callback)
         {
             add(sFailedDownloadCount, 1);
-            callback(mVFS, asset_id, atype, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LL_EXSTAT_NULL_UUID);
+            callback(mVFS, asset_id, atype, user_data, LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE, LLExtStat::NULL_UUID);
         }
         return;
     }
@@ -741,7 +741,7 @@ void LLAssetStorage::getEstateAsset(
         // unless there's a weird error
         if (callback)
         {
-            callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
+            callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LLExtStat::VFS_CACHED);
         }
     }
     else
@@ -792,7 +792,7 @@ void LLAssetStorage::getEstateAsset(
             if (callback)
             {
                 add(sFailedDownloadCount, 1);
-                callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
+                callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LLExtStat::NO_UPSTREAM);
             }
         }
     }
@@ -885,7 +885,7 @@ void LLAssetStorage::getInvItemAsset(
         // unless there's a weird error
         if (callback)
         {
-            callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LL_EXSTAT_VFS_CACHED);
+            callback(mVFS, asset_id, atype, user_data, LL_ERR_NOERR, LLExtStat::VFS_CACHED);
         }
     }
     else
@@ -936,7 +936,7 @@ void LLAssetStorage::getInvItemAsset(
             if (callback)
             {
                 add(sFailedDownloadCount, 1);
-                callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
+                callback(mVFS, asset_id, atype, user_data, LL_ERR_CIRCUIT_GONE, LLExtStat::NO_UPSTREAM);
             }
         }
     }
@@ -1034,7 +1034,7 @@ void LLAssetStorage::processUploadComplete(LLMessageSystem *msg, void **user_dat
     msg->getBOOLFast(_PREHASH_AssetBlock, _PREHASH_Success, success);
 
     asset_type = (LLAssetType::EType)asset_type_s8;
-    this_ptr->_callUploadCallbacks(uuid, asset_type, success, LL_EXSTAT_NONE);
+    this_ptr->_callUploadCallbacks(uuid, asset_type, success, LLExtStat::NONE);
 }
 
 void LLAssetStorage::_callUploadCallbacks(const LLUUID &uuid, LLAssetType::EType asset_type, BOOL success, LLExtStat ext_status )
@@ -1288,12 +1288,12 @@ bool LLAssetStorage::deletePendingRequestImpl(LLAssetStorage::request_list_t* re
         // Run callbacks.
         if (req->mUpCallback)
         {
-            req->mUpCallback(req->getUUID(), req->mUserData, error, LL_EXSTAT_REQUEST_DROPPED);
+            req->mUpCallback(req->getUUID(), req->mUserData, error, LLExtStat::REQUEST_DROPPED);
         }
         if (req->mDownCallback)
         {
             add(sFailedDownloadCount, 1);
-            req->mDownCallback(mVFS, req->getUUID(), req->getType(), req->mUserData, error, LL_EXSTAT_REQUEST_DROPPED);
+            req->mDownCallback(mVFS, req->getUUID(), req->getType(), req->mUserData, error, LLExtStat::REQUEST_DROPPED);
         }
         if (req->mInfoCallback)
         {
diff --git a/indra/llmessage/llextendedstatus.h b/indra/llmessage/llextendedstatus.h
index 8ce173d1ffd63ae0a80b2b7ace1515d83ea71061..9923d73c1a9b0370ab50f7f212915ff040c1168a 100644
--- a/indra/llmessage/llextendedstatus.h
+++ b/indra/llmessage/llextendedstatus.h
@@ -28,40 +28,36 @@
 #ifndef LL_LLEXTENDEDSTATUS_H
 #define LL_LLEXTENDEDSTATUS_H
 
-
-typedef S32 LLExtStat;
-
-
-// Status provider groups - Top bits indicate which status type it is
-// Zero is common status code (next section)
-const LLExtStat LL_EXSTAT_CURL_RESULT	= 1L<<30; // serviced by curl - use 1L if we really implement the below
-const LLExtStat LL_EXSTAT_RES_RESULT	= 2L<<30; // serviced by resident copy
-const LLExtStat LL_EXSTAT_VFS_RESULT	= 3L<<30; // serviced by vfs
-
-
-// Common Status Codes
-//
-const LLExtStat LL_EXSTAT_NONE				= 0x00000; // No extra info here - sorry!
-const LLExtStat LL_EXSTAT_NULL_UUID			= 0x10001; // null asset ID
-const LLExtStat LL_EXSTAT_NO_UPSTREAM		= 0x10002; // attempt to upload without a valid upstream method/provider
-const LLExtStat LL_EXSTAT_REQUEST_DROPPED	= 0x10003; // request was dropped unserviced
-const LLExtStat LL_EXSTAT_NONEXISTENT_FILE	= 0x10004; // trying to upload a file that doesn't exist
-const LLExtStat LL_EXSTAT_BLOCKED_FILE		= 0x10005; // trying to upload a file that we can't open
-
-
-// curl status codes:
-//
-// Mask off LL_EXSTAT_CURL_RESULT for original result and
-// see: libraries/include/curl/curl.h
-
-
-// Memory-Resident status codes:
-// None at present
-
-
-// VFS status codes:
-const LLExtStat LL_EXSTAT_VFS_CACHED	= LL_EXSTAT_VFS_RESULT | 0x0001;
-const LLExtStat LL_EXSTAT_VFS_CORRUPT	= LL_EXSTAT_VFS_RESULT | 0x0002;
+enum class LLExtStat: uint32_t
+{
+	// Status provider groups - Top bits indicate which status type it is
+	// Zero is common status code (next section)
+	CURL_RESULT	= 1UL<<30, // serviced by curl - use 1L if we really implement the below
+	RES_RESULT	= 2UL<<30, // serviced by resident copy
+	VFS_RESULT	= 3UL<<30, // serviced by vfs
+
+
+	// Common Status Codes
+	//
+	NONE			= 0x00000, // No extra info here - sorry!
+	NULL_UUID		= 0x10001, // null asset ID
+	NO_UPSTREAM		= 0x10002, // attempt to upload without a valid upstream method/provider
+	REQUEST_DROPPED	= 0x10003, // request was dropped unserviced
+	NONEXISTENT_FILE= 0x10004, // trying to upload a file that doesn't exist
+	BLOCKED_FILE	= 0x10005, // trying to upload a file that we can't open
+
+	// curl status codes:
+	//
+	// Mask off CURL_RESULT for original result and
+	// see: libraries/include/curl/curl.h
+
+	// Memory-Resident status codes:
+	// None at present
+
+	// VFS status codes:
+	VFS_CACHED	= VFS_RESULT | 0x0001,
+	VFS_CORRUPT	= VFS_RESULT | 0x0002,
+};
 
 
 #endif // LL_LLEXTENDEDSTATUS_H
diff --git a/indra/llmessage/lltransfertargetvfile.cpp b/indra/llmessage/lltransfertargetvfile.cpp
index a572c68a7f8a6d20746cfa774eb989a59431079b..b27f0881e0fcc54792accd829506afd3ec1fef58 100644
--- a/indra/llmessage/lltransfertargetvfile.cpp
+++ b/indra/llmessage/lltransfertargetvfile.cpp
@@ -227,7 +227,7 @@ void LLTransferTargetVFile::completionCallback(const LLTSCode status)
                 mParams.getAssetID(),
                 mParams.getAssetType(),
                 mParams.mRequestDatap,
-                LL_EXSTAT_NONE);
+				LLExtStat::NONE);
         }
         delete mParams.mRequestDatap;
         mParams.mRequestDatap = NULL;
diff --git a/indra/llmessage/llxfer.cpp b/indra/llmessage/llxfer.cpp
index 32e0e2cc3b2b8da4045c78c86c32da39c5e93d03..93d5cfc13156b71d5e89a1baf71b23dee9355a42 100644
--- a/indra/llmessage/llxfer.cpp
+++ b/indra/llmessage/llxfer.cpp
@@ -319,7 +319,7 @@ S32 LLXfer::processEOF()
 
 	if (mCallback)
 	{
-		mCallback(mCallbackDataHandle,mCallbackResult,LL_EXSTAT_NONE);
+		mCallback(mCallbackDataHandle,mCallbackResult, LLExtStat::NONE);
 	}
 
 	return(retval);
diff --git a/indra/llmessage/llxfer_mem.cpp b/indra/llmessage/llxfer_mem.cpp
index 78a3e4f5581b9921972c850a9daf737d2ee8aa4c..da8534ecdcbb260a77261dbbe39aea77b6d2a0ce 100644
--- a/indra/llmessage/llxfer_mem.cpp
+++ b/indra/llmessage/llxfer_mem.cpp
@@ -112,7 +112,7 @@ S32 LLXfer_Mem::processEOF()
 
 	if (mCallback)
 	{
-		mCallback((void *)mBuffer,mBufferLength,mCallbackDataHandle,mCallbackResult,LL_EXSTAT_NONE);
+		mCallback((void *)mBuffer,mBufferLength,mCallbackDataHandle,mCallbackResult, LLExtStat::NONE);
 	}
 
 	return(retval);
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 84f3796398d337e46df7cd667eded36bfae390d1..498dfca1a36f708b823d2fd0bb76abbae707917a 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -585,10 +585,10 @@ bool LLGLManager::initGL()
 
 	// Extract video card strings and convert to upper case to
 	// work around driver-to-driver variation in capitalization.
-	mGLVendor = std::string((const char *)glGetString(GL_VENDOR));
+	mGLVendor = ll_safe_string((const char *)glGetString(GL_VENDOR));
 	LLStringUtil::toUpper(mGLVendor);
 
-	mGLRenderer = std::string((const char *)glGetString(GL_RENDERER));
+	mGLRenderer = ll_safe_string((const char *)glGetString(GL_RENDERER));
 	LLStringUtil::toUpper(mGLRenderer);
 
 	parse_gl_version( &mDriverVersionMajor, 
@@ -887,9 +887,9 @@ void LLGLManager::getGLInfo(LLSD& info)
 	}
 	else
 	{
-		info["GLInfo"]["GLVendor"] = std::string((const char *)glGetString(GL_VENDOR));
-		info["GLInfo"]["GLRenderer"] = std::string((const char *)glGetString(GL_RENDERER));
-		info["GLInfo"]["GLVersion"] = std::string((const char *)glGetString(GL_VERSION));
+		info["GLInfo"]["GLVendor"] = ll_safe_string((const char *)glGetString(GL_VENDOR));
+		info["GLInfo"]["GLRenderer"] = ll_safe_string((const char *)glGetString(GL_RENDERER));
+		info["GLInfo"]["GLVersion"] = ll_safe_string((const char *)glGetString(GL_VERSION));
 	}
 
 #if !LL_MESA_HEADLESS
@@ -939,9 +939,9 @@ void LLGLManager::printGLInfoString()
 	}
 	else
 	{
-		LL_INFOS("RenderInit") << "GL_VENDOR:     " << ((const char *)glGetString(GL_VENDOR)) << LL_ENDL;
-		LL_INFOS("RenderInit") << "GL_RENDERER:   " << ((const char *)glGetString(GL_RENDERER)) << LL_ENDL;
-		LL_INFOS("RenderInit") << "GL_VERSION:    " << ((const char *)glGetString(GL_VERSION)) << LL_ENDL;
+		LL_INFOS("RenderInit") << "GL_VENDOR:     " << ll_safe_string((const char *)glGetString(GL_VENDOR)) << LL_ENDL;
+		LL_INFOS("RenderInit") << "GL_RENDERER:   " << ll_safe_string((const char *)glGetString(GL_RENDERER)) << LL_ENDL;
+		LL_INFOS("RenderInit") << "GL_VERSION:    " << ll_safe_string((const char *)glGetString(GL_VERSION)) << LL_ENDL;
 	}
 
 #if !LL_MESA_HEADLESS
diff --git a/indra/llui/llrngwriter.cpp b/indra/llui/llrngwriter.cpp
index e4a31d6a79c957fc0dbc1be057aebb57a4a2e4ad..4bd1561425628ed9af58d34b0810b6110dce4752 100644
--- a/indra/llui/llrngwriter.cpp
+++ b/indra/llui/llrngwriter.cpp
@@ -29,14 +29,7 @@
 #include "llrngwriter.h"
 #include "lluicolor.h"
 
-#if LL_DARWIN
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdelete-incomplete"
 #include "lluictrlfactory.h"
-#pragma clang diagnostic pop
-#else
-#include "lluictrlfactory.h"
-#endif
 
 #include "boost/bind.hpp"
 
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index 03d946f1b7729e6cc9808ba78529e5abc06b0877..135ed57a4fba36249863421e70f464bdd38789b3 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -37,6 +37,7 @@
 #include "llheteromap.h"
 
 class LLView;
+void deleteView(LLView*); // Inside LLView.cpp, avoid having to potentially delete an incomplete type here.
 
 // lookup widget constructor funcs by widget name
 template <typename DERIVED_TYPE>
@@ -160,8 +161,8 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
 			LLXMLNodePtr root_node;
 
 			if (!LLUICtrlFactory::getLayeredXMLNode(filename, root_node))
-				{							
-				LL_WARNS() << "Couldn't parse XUI file: " << instance().getCurFileName() << LL_ENDL;
+			{
+                LL_WARNS() << "Couldn't parse XUI from path: " << instance().getCurFileName() << ", from filename: " << filename << LL_ENDL;
 				goto fail;
 			}
 
@@ -174,14 +175,7 @@ class LLUICtrlFactory : public LLSingleton<LLUICtrlFactory>
 				{
 					LL_WARNS() << "Widget in " << filename << " was of type " << typeid(view).name() << " instead of expected type " << typeid(T).name() << LL_ENDL;
 
-#if LL_DARWIN
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdelete-incomplete"
-					delete view;
-#pragma clang diagnostic pop
-#else
-					delete view;
-#endif
+					deleteView(view);
 					view = NULL;
 				}
 			}
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 593c8b12fc8a7c328de2e52eabba3a4ed8340c6b..bd213d594a90e250ed20eaca001c081cdc178be6 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -86,6 +86,11 @@ template class LLView* LLView::getChild<class LLView>(
 
 static LLDefaultChildRegistry::Register<LLView> r("view");
 
+void deleteView(LLView *aView)
+{
+	delete aView;
+}
+
 namespace LLInitParam
 {
 	void TypeValues<LLView::EOrientation>::declareValues()
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 0b3936f8a5c12b805955824c31aa183d17513a14..7783505c27ef07c4b340981ad9638aaca96cce17 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -714,6 +714,7 @@ LLWindowWin32::~LLWindowWin32()
 
 void LLWindowWin32::show()
 {
+    LL_DEBUGS("Window") << "Setting window to show" << LL_ENDL;
 	ShowWindow(mWindowHandle, SW_SHOW);
 	SetForegroundWindow(mWindowHandle);
 	SetFocus(mWindowHandle);
@@ -1126,6 +1127,12 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO
 	mPostQuit = FALSE;
 
 	// create window
+    LL_DEBUGS("Window") << "Creating window with X: " << window_rect.left
+        << " Y: " << window_rect.top
+        << " Width: " << (window_rect.right - window_rect.left)
+        << " Height: " << (window_rect.bottom - window_rect.top)
+        << " Fullscreen: " << mFullscreen
+        << LL_ENDL;
 	DestroyWindow(mWindowHandle);
 	mWindowHandle = CreateWindowEx(dw_ex_style,
 		mWindowClassName,
@@ -1941,6 +1948,8 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 
 	LLWindowWin32 *window_imp = (LLWindowWin32 *)GetWindowLongPtr( h_wnd, GWLP_USERDATA );
 
+	bool debug_window_proc = gDebugWindowProc || debugLoggingEnabled("Window");
+
 
 	if (NULL != window_imp)
 	{
@@ -1983,9 +1992,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 
 		case WM_DEVICECHANGE:
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_DEVICECHANGE");
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
-				LL_INFOS() << "  WM_DEVICECHANGE: wParam=" << w_param 
+				LL_INFOS("Window") << "  WM_DEVICECHANGE: wParam=" << w_param 
 						<< "; lParam=" << l_param << LL_ENDL;
 			}
 			if (w_param == DBT_DEVNODES_CHANGED || w_param == DBT_DEVICEARRIVAL)
@@ -2041,7 +2050,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				BOOL activating = (BOOL) w_param;
 				BOOL minimized = window_imp->getMinimized();
 
-				if (gDebugWindowProc)
+				if (debug_window_proc)
 				{
 					LL_INFOS("Window") << "WINDOWPROC ActivateApp "
 						<< " activating " << S32(activating)
@@ -2092,7 +2101,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				// JC - I'm not sure why, but if we don't report that we handled the 
 				// WM_ACTIVATE message, the WM_ACTIVATEAPP messages don't work 
 				// properly when we run fullscreen.
-				if (gDebugWindowProc)
+				if (debug_window_proc)
 				{
 					LL_INFOS("Window") << "WINDOWPROC Activate "
 						<< " activating " << S32(activating) 
@@ -2164,7 +2173,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KEYDOWN");
 			{
-				if (gDebugWindowProc)
+				if (debug_window_proc)
 				{
 					LL_INFOS("Window") << "Debug WindowProc WM_KEYDOWN "
 						<< " key " << S32(w_param) 
@@ -2190,7 +2199,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_KEYUP");
 			LL_RECORD_BLOCK_TIME(FTM_KEYHANDLER);
 
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
 				LL_INFOS("Window") << "Debug WindowProc WM_KEYUP "
 					<< " key " << S32(w_param) 
@@ -2206,9 +2215,9 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 		}
 		case WM_IME_SETCONTEXT:
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_SETCONTEXT");
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
-				LL_INFOS() << "WM_IME_SETCONTEXT" << LL_ENDL;
+				LL_INFOS("Window") << "WM_IME_SETCONTEXT" << LL_ENDL;
 			}
 			if (LLWinImm::isAvailable() && window_imp->mPreeditor)
 			{
@@ -2219,7 +2228,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 
 		case WM_IME_STARTCOMPOSITION:
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_STARTCOMPOSITION");
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
 				LL_INFOS() << "WM_IME_STARTCOMPOSITION" << LL_ENDL;
 			}
@@ -2232,7 +2241,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 
 		case WM_IME_ENDCOMPOSITION:
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_ENDCOMPOSITION");
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
 				LL_INFOS() << "WM_IME_ENDCOMPOSITION" << LL_ENDL;
 			}
@@ -2244,7 +2253,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 
 		case WM_IME_COMPOSITION:
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_COMPOSITION");
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
 				LL_INFOS() << "WM_IME_COMPOSITION" << LL_ENDL;
 			}
@@ -2257,7 +2266,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 
 		case WM_IME_REQUEST:
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_IME_REQUEST");
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
 				LL_INFOS() << "WM_IME_REQUEST" << LL_ENDL;
 			}
@@ -2288,7 +2297,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 			// characters.  We just need to take care of surrogate pairs sent as two WM_CHAR's
 			// by ourselves.  It is not that tough.  -- Alissa Sabre @ SL
 			window_imp->mCallbacks->handlePingWatchdog(window_imp, "Main:WM_CHAR");
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
 				LL_INFOS("Window") << "Debug WindowProc WM_CHAR "
 					<< " key " << S32(w_param) 
@@ -2731,7 +2740,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 				S32 width = S32( LOWORD(l_param) );
 				S32 height = S32( HIWORD(l_param) );
 
-				if (gDebugWindowProc)
+				if (debug_window_proc)
 				{
 					BOOL maximized = ( w_param == SIZE_MAXIMIZED );
 					BOOL restored  = ( w_param == SIZE_RESTORED );
@@ -2806,7 +2815,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 			}
 
 		case WM_SETFOCUS:
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
 				LL_INFOS("Window") << "WINDOWPROC SetFocus" << LL_ENDL;
 			}
@@ -2815,7 +2824,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 			return 0;
 
 		case WM_KILLFOCUS:
-			if (gDebugWindowProc)
+			if (debug_window_proc)
 			{
 				LL_INFOS("Window") << "WINDOWPROC KillFocus" << LL_ENDL;
 			}
@@ -2847,7 +2856,7 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 			break;
 		default:
 			{
-				if (gDebugWindowProc)
+				if (debug_window_proc)
 				{
 					LL_INFOS("Window") << "Unhandled windows message code: " << U32(u_msg) << LL_ENDL;
 				}
@@ -2857,7 +2866,11 @@ LRESULT CALLBACK LLWindowWin32::mainWindowProc(HWND h_wnd, UINT u_msg, WPARAM w_
 
 	window_imp->mCallbacks->handlePauseWatchdog(window_imp);	
 	}
-
+    else
+    {
+        // (NULL == window_imp)
+        LL_DEBUGS("Window") << "No window implementation to handle message with, message code: " << U32(u_msg) << LL_ENDL;
+    }
 
 	// pass unhandled messages down to Windows
 	return DefWindowProc(h_wnd, u_msg, w_param, l_param);
diff --git a/indra/llxml/CMakeLists.txt b/indra/llxml/CMakeLists.txt
index 17400a203e8485bb46b62f4011c60e1fe93fad36..013a422d35b07863647a3d6309cc94db869e571d 100644
--- a/indra/llxml/CMakeLists.txt
+++ b/indra/llxml/CMakeLists.txt
@@ -28,7 +28,6 @@ set(llxml_HEADER_FILES
     CMakeLists.txt
 
     llcontrol.h
-    llcontrolgroupreader.h
     llxmlnode.h
     llxmlparser.h
     llxmltree.h
diff --git a/indra/llxml/llcontrol.h b/indra/llxml/llcontrol.h
index 6e6004cdb2a07556d9b5992c2f1bcf9361ddc906..99946607f426e86a82bc8a70f340e0a0d576f858 100644
--- a/indra/llxml/llcontrol.h
+++ b/indra/llxml/llcontrol.h
@@ -34,8 +34,6 @@
 #include "llrefcount.h"
 #include "llinstancetracker.h"
 
-#include "llcontrolgroupreader.h"
-
 #include <vector>
 
 // *NOTE: boost::visit_each<> generates warning 4675 on .net 2003
diff --git a/indra/llxml/llcontrolgroupreader.h b/indra/llxml/llcontrolgroupreader.h
deleted file mode 100644
index fe77d33fc420793e1f725303bd2c5b78902cab5d..0000000000000000000000000000000000000000
--- a/indra/llxml/llcontrolgroupreader.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/** 
- * @file llcontrolgroupreader.h
- * @brief Interface providing readonly access to LLControlGroup (intended for unit testing)
- *
- * $LicenseInfo:firstyear=2001&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- * 
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- * 
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- * 
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- * 
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLCONTROLGROUPREADER_H
-#define LL_LLCONTROLGROUPREADER_H
-
-#include "stdtypes.h"
-#include <string>
-
-#include "v3math.h"
-#include "v3dmath.h"
-#include "v3color.h"
-#include "v4color.h"
-#include "llrect.h"
-
-class LLControlGroupReader
-{
-public:
-	LLControlGroupReader() {}
-	virtual ~LLControlGroupReader() {}
-
-	virtual std::string getString(const std::string& name) { return ""; }
-	virtual LLWString	getWString(const std::string& name) { return LLWString(); }
-	virtual std::string	getText(const std::string& name) { return ""; }
-	virtual LLVector3	getVector3(const std::string& name) { return LLVector3(); }
-	virtual LLVector3d	getVector3d(const std::string& name) { return LLVector3d(); }
-	virtual LLRect		getRect(const std::string& name) { return LLRect(); }
-	virtual BOOL		getBOOL(const std::string& name) { return FALSE; }
-	virtual S32			getS32(const std::string& name) { return 0; }
-	virtual F32			getF32(const std::string& name) {return 0.0f; }
-	virtual U32			getU32(const std::string& name) {return 0; }
-	virtual LLSD        getLLSD(const std::string& name) { return LLSD(); }
-
-	virtual LLColor4	getColor(const std::string& name) { return LLColor4(); }
-	virtual LLColor4	getColor4(const std::string& name) { return LLColor4(); }
-	virtual LLColor3	getColor3(const std::string& name) { return LLColor3(); }
-	
-	virtual void		setBOOL(const std::string& name, BOOL val) {}
-	virtual void		setS32(const std::string& name, S32 val) {}
-	virtual void		setF32(const std::string& name, F32 val) {}
-	virtual void		setU32(const std::string& name, U32 val) {}
-	virtual void		setString(const std::string&  name, const std::string& val) {}
-	virtual void		setVector3(const std::string& name, const LLVector3 &val) {}
-	virtual void		setVector3d(const std::string& name, const LLVector3d &val) {}
-	virtual void		setQuaternion(const std::string& name, const LLQuaternion &val) {}
-	virtual void		setRect(const std::string& name, const LLRect &val) {}
-	virtual void		setColor4(const std::string& name, const LLColor4 &val) {}
-	virtual void    	setLLSD(const std::string& name, const LLSD& val) {}
-};
-
-#endif /* LL_LLCONTROLGROUPREADER_H */
-
-
-
-
-
-
-
diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt
index 3c43d71599b1fa135536542d5d59826b27376126..4b20d9700ded7107443a705c0413b347e7ba33ee 100644
--- a/indra/newview/VIEWER_VERSION.txt
+++ b/indra/newview/VIEWER_VERSION.txt
@@ -1 +1 @@
-6.4.7
+6.4.8
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index dfc3c7b89da852cd3dd1f3cabe37eff899794db5..a00aa86d784df4b1dcf713e604449d43581c251d 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -15161,7 +15161,7 @@
         <key>Value</key>
             <real>1</real>
         </map>
-    <key>PoolSizeAssetStorage</key>
+    <key>PoolSizeVAssetStorage</key>
         <map>
         <key>Comment</key>
             <string>Coroutine Pool size for AssetStorage requests</string>
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f6d6f7c8972fde96566e467b044ee61db72c13e4..f3df79fb6bd0bbcd6d5021d456bc8a039d3da61e 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -830,6 +830,17 @@ bool LLAgent::enableFlying()
 	return !sitting;
 }
 
+// static
+bool LLAgent::isSitting()
+{
+    BOOL sitting = FALSE;
+    if (isAgentAvatarValid())
+    {
+        sitting = gAgentAvatarp->isSitting();
+    }
+    return sitting;
+}
+
 void LLAgent::standUp()
 {
 	setControlFlags(AGENT_CONTROL_STAND_UP);
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 1a352d339719aa4c2ae0c06dc977e6484395acf5..88cce0b9111e95155ce2a390ef6867dbbdf124df 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -351,6 +351,7 @@ class LLAgent : public LLOldEvents::LLObservable
 	static void		toggleFlying();
 	static bool		enableFlying();
 	BOOL			canFly(); 			// Does this parcel allow you to fly?
+	static bool		isSitting();
 
 	//--------------------------------------------------------------------
 	// Voice
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 9401481e8c9f990196153109d6658ebd7aaab2d5..75574df00e8637686dbe75cc5015ffb6ce329cb2 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1131,7 +1131,10 @@ bool LLAppViewer::init()
 	gSimLastTime = gRenderStartTime.getElapsedTimeF32();
 	gSimFrames = (F32)gFrameCount;
 
-	LLViewerJoystick::getInstance()->init(false);
+    if (gSavedSettings.getBOOL("JoystickEnabled"))
+    {
+        LLViewerJoystick::getInstance()->init(false);
+    }
 
 	try {
 		initializeSecHandler();
@@ -1848,8 +1851,11 @@ bool LLAppViewer::cleanup()
 	delete gKeyboard;
 	gKeyboard = NULL;
 
-	// Turn off Space Navigator and similar devices
-	LLViewerJoystick::getInstance()->terminate();
+    if (LLViewerJoystick::instanceExists())
+    {
+        // Turn off Space Navigator and similar devices
+        LLViewerJoystick::getInstance()->terminate();
+    }
 
 	LL_INFOS() << "Cleaning up Objects" << LL_ENDL;
 
@@ -3129,8 +3135,8 @@ LLSD LLAppViewer::getViewerInfo() const
 	info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits<LLUnits::Megabytes>());
 	// Moved hack adjustment to Windows memory size into llsys.cpp
 	info["OS_VERSION"] = LLOSInfo::instance().getOSString();
-	info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR));
-	info["GRAPHICS_CARD"] = (const char*)(glGetString(GL_RENDERER));
+	info["GRAPHICS_CARD_VENDOR"] = ll_safe_string((const char*)(glGetString(GL_VENDOR)));
+	info["GRAPHICS_CARD"] = ll_safe_string((const char*)(glGetString(GL_RENDERER)));
 
 #if LL_WINDOWS
 	std::string drvinfo = gDXHardware.getDriverVersionWMI();
@@ -3149,7 +3155,7 @@ LLSD LLAppViewer::getViewerInfo() const
 	}
 #endif
 
-	info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION));
+	info["OPENGL_VERSION"] = ll_safe_string((const char*)(glGetString(GL_VERSION)));
 
     // Settings
 
@@ -4518,6 +4524,7 @@ void LLAppViewer::saveFinalSnapshot()
 									gViewerWindow->getWindowWidthRaw(),
 									gViewerWindow->getWindowHeightRaw(),
 									FALSE,
+									gSavedSettings.getBOOL("RenderHUDInSnapshot"),
 									TRUE,
 									LLSnapshotModel::SNAPSHOT_TYPE_COLOR,
 									LLSnapshotModel::SNAPSHOT_FORMAT_PNG);
diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp
index 4131af828e4d4f5cf14bd6fab1b0fe8d3ab27436..431a8c60be6de86f2f82ebfa6a27fcf876b954ac 100644
--- a/indra/newview/llchathistory.cpp
+++ b/indra/newview/llchathistory.cpp
@@ -1085,7 +1085,8 @@ LLView* LLChatHistory::getSeparator()
 LLView* LLChatHistory::getHeader(const LLChat& chat,const LLStyle::Params& style_params, const LLSD& args)
 {
 	LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename);
-	header->setup(chat, style_params, args);
+    if (header)
+        header->setup(chat, style_params, args);
 	return header;
 }
 
@@ -1298,6 +1299,12 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
 			view = getSeparator();
 			p.top_pad = mTopSeparatorPad;
 			p.bottom_pad = mBottomSeparatorPad;
+            if (!view)
+            {
+                // Might be wiser to make this LL_ERRS, getSeparator() should work in case of correct instalation.
+                LL_WARNS() << "Failed to create separator from " << mMessageSeparatorFilename << ": can't append to history" << LL_ENDL;
+                return;
+            }
 		}
 		else
 		{
@@ -1306,7 +1313,12 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL
 				p.top_pad = 0;
 			else
 				p.top_pad = mTopHeaderPad;
-			p.bottom_pad = mBottomHeaderPad;
+            p.bottom_pad = mBottomHeaderPad;
+            if (!view)
+            {
+                LL_WARNS() << "Failed to create header from " << mMessageHeaderFilename << ": can't append to history" << LL_ENDL;
+                return;
+            }
 			
 		}
 		p.view = view;
diff --git a/indra/newview/llcommandhandler.cpp b/indra/newview/llcommandhandler.cpp
index 76d965b1f155e94ca2a598919e33d01f6c84517e..23e2271eae55381e4e42194b58aa8438fbb57764 100644
--- a/indra/newview/llcommandhandler.cpp
+++ b/indra/newview/llcommandhandler.cpp
@@ -222,7 +222,7 @@ struct symbol_info
 
 #define ent(SYMBOL)										\
 	{													\
-		#SYMBOL + 28, /* skip "LLCommandHandler::UNTRUSTED_" prefix */	\
+		&#SYMBOL[28], /* skip "LLCommandHandler::UNTRUSTED_" prefix */	\
 		SYMBOL											\
 	}
 
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 17952349dc28dc6879782d4d1d59f00dd59df2b1..347997a69a6ad9cef52cf76e2de55a567fe6b81f 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -1590,14 +1590,29 @@ void LLFavoritesOrderStorage::load()
 												<< (fav_llsd.isMap() ? "" : "un") << "successfully"
 												<< LL_ENDL;
 				in_file.close();
-				user_llsd = fav_llsd[gAgentUsername];
+				if (fav_llsd.isMap() && fav_llsd.has(gAgentUsername))
+				{
+					user_llsd = fav_llsd[gAgentUsername];
 
-				S32 index = 0;
-				for (LLSD::array_iterator iter = user_llsd.beginArray();
+					S32 index = 0;
+					bool needs_validation = gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin");
+					for (LLSD::array_iterator iter = user_llsd.beginArray();
 						iter != user_llsd.endArray(); ++iter)
-				{
-					mSortIndexes.insert(std::make_pair(iter->get("id").asUUID(), index));
-					index++;
+					{
+						// Validation
+						LLUUID fv_id = iter->get("id").asUUID();
+						if (needs_validation
+							&& (fv_id.isNull()
+								|| iter->get("asset_id").asUUID().isNull()
+								|| iter->get("name").asString().empty()
+								|| iter->get("slurl").asString().empty()))
+						{
+							mRecreateFavoriteStorage = true;
+						}
+
+						mSortIndexes.insert(std::make_pair(fv_id, index));
+						index++;
+					}
 				}
 			}
 			else
@@ -1841,6 +1856,8 @@ void LLFavoritesOrderStorage::rearrangeFavoriteLandmarks(const LLUUID& source_it
 
 BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
 {
+	pref_changed |= mRecreateFavoriteStorage;
+	mRecreateFavoriteStorage = false;
 
 	LLUUID favorite_folder= gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE);
 	if (favorite_folder.isNull())
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
index d93161fd7ac4ae8644095aace2999fc11822b000..571208aa31b201f1c42e73c8cbf63668daa7eec7 100644
--- a/indra/newview/llfavoritesbar.h
+++ b/indra/newview/llfavoritesbar.h
@@ -248,6 +248,7 @@ class LLFavoritesOrderStorage : public LLSingleton<LLFavoritesOrderStorage>
 	slurls_map_t mSLURLs;
 	std::set<LLUUID> mMissingSLURLs;
 	bool mIsDirty;
+	bool mRecreateFavoriteStorage;
 
 	struct IsNotInFavorites
 	{
@@ -278,7 +279,9 @@ class LLFavoritesOrderStorage : public LLSingleton<LLFavoritesOrderStorage>
 
 inline
 LLFavoritesOrderStorage::LLFavoritesOrderStorage() :
-	mIsDirty(false), mUpdateRequired(false)
+	mIsDirty(false),
+	mUpdateRequired(false),
+	mRecreateFavoriteStorage(false)
 { load(); }
 
 #endif // LL_LLFAVORITESBARCTRL_H
diff --git a/indra/newview/llfloaterauction.cpp b/indra/newview/llfloaterauction.cpp
index 56619e818af2526f399da48e11796809130da5c5..957b2e1e8ef008d21980b77b1b09bebc653b5865 100644
--- a/indra/newview/llfloaterauction.cpp
+++ b/indra/newview/llfloaterauction.cpp
@@ -182,8 +182,11 @@ void LLFloaterAuction::onClickSnapshot(void* data)
 	BOOL success = gViewerWindow->rawSnapshot(raw,
 											  gViewerWindow->getWindowWidthScaled(),
 											  gViewerWindow->getWindowHeightScaled(),
-											  TRUE, FALSE,
-											  FALSE, FALSE);
+											  TRUE,
+											  FALSE,
+											  FALSE, //UI
+											  FALSE, //HUD
+											  FALSE);
 	gForceRenderLandFence = FALSE;
 
 	if (success)
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp
index 33099db1b946c0b10f8ace73c6b1cd4e26eb95a3..ab95bc06b889f1fcbdf7da58130dc6690561e77f 100644
--- a/indra/newview/llfloateravatarpicker.cpp
+++ b/indra/newview/llfloateravatarpicker.cpp
@@ -361,59 +361,8 @@ void LLFloaterAvatarPicker::populateFriend()
 
 void LLFloaterAvatarPicker::drawFrustum()
 {
-    if(mFrustumOrigin.get())
-    {
-        LLView * frustumOrigin = mFrustumOrigin.get();
-        LLRect origin_rect;
-        frustumOrigin->localRectToOtherView(frustumOrigin->getLocalRect(), &origin_rect, this);
-        // draw context cone connecting color picker with color swatch in parent floater
-        LLRect local_rect = getLocalRect();
-        if (hasFocus() && frustumOrigin->isInVisibleChain() && mContextConeOpacity > 0.001f)
-        {
-            gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
-            LLGLEnable(GL_CULL_FACE);
-            gGL.begin(LLRender::QUADS);
-            {
-                gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity);
-                gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop);
-                gGL.vertex2i(origin_rect.mRight, origin_rect.mTop);
-                gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity);
-                gGL.vertex2i(local_rect.mRight, local_rect.mTop);
-                gGL.vertex2i(local_rect.mLeft, local_rect.mTop);
-
-                gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity);
-                gGL.vertex2i(local_rect.mLeft, local_rect.mTop);
-                gGL.vertex2i(local_rect.mLeft, local_rect.mBottom);
-                gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity);
-                gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom);
-                gGL.vertex2i(origin_rect.mLeft, origin_rect.mTop);
-
-                gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity);
-                gGL.vertex2i(local_rect.mRight, local_rect.mBottom);
-                gGL.vertex2i(local_rect.mRight, local_rect.mTop);
-                gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity);
-                gGL.vertex2i(origin_rect.mRight, origin_rect.mTop);
-                gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom);
-
-                gGL.color4f(0.f, 0.f, 0.f, mContextConeOutAlpha * mContextConeOpacity);
-                gGL.vertex2i(local_rect.mLeft, local_rect.mBottom);
-                gGL.vertex2i(local_rect.mRight, local_rect.mBottom);
-                gGL.color4f(0.f, 0.f, 0.f, mContextConeInAlpha * mContextConeOpacity);
-                gGL.vertex2i(origin_rect.mRight, origin_rect.mBottom);
-                gGL.vertex2i(origin_rect.mLeft, origin_rect.mBottom);
-            }
-            gGL.end();
-        }
-
-        if (gFocusMgr.childHasMouseCapture(getDragHandle()))
-        {
-            mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(mContextConeFadeTime));
-        }
-        else
-        {
-            mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(mContextConeFadeTime));
-        }
-    }
+    static LLCachedControl<F32> max_opacity(gSavedSettings, "PickerContextOpacity", 0.4f);
+    drawConeToOwner(mContextConeOpacity, max_opacity, mFrustumOrigin.get(), mContextConeFadeTime, mContextConeInAlpha, mContextConeOutAlpha);
 }
 
 void LLFloaterAvatarPicker::draw()
diff --git a/indra/newview/llfloaterjoystick.cpp b/indra/newview/llfloaterjoystick.cpp
index ee3d633dd08f4ad312096262fdb35a12f5f228f7..2b672bc89002d02f4d853f68132cddea3fa09d35 100644
--- a/indra/newview/llfloaterjoystick.cpp
+++ b/indra/newview/llfloaterjoystick.cpp
@@ -61,6 +61,11 @@ static LLTrace::SampleStatHandle<>* sJoystickAxes[6] =
 LLFloaterJoystick::LLFloaterJoystick(const LLSD& data)
 	: LLFloater(data)
 {
+    if (!LLViewerJoystick::getInstance()->isJoystickInitialized())
+    {
+        LLViewerJoystick::getInstance()->init(false);
+    }
+
 	initFromSettings();
 }
 
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 951d11bbe5461fdeaded6139eedb7566fc37515d..81f4b2234ca0972cd41e3093fb508a9577dcc26b 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -1282,12 +1282,12 @@ void LLFloaterPreference::buildPopupLists()
 						if (it->second.asBoolean())
 						{
 							row["columns"][1]["value"] = formp->getElement(it->first)["ignore"].asString();
+							row["columns"][1]["font"] = "SANSSERIF_SMALL";
+							row["columns"][1]["width"] = 360;
 							break;
 						}
 					}
 				}
-				row["columns"][1]["font"] = "SANSSERIF_SMALL";
-				row["columns"][1]["width"] = 360;
 			}
 			item = disabled_popups.addElement(row);
 		}
diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp
index 64b7880938a33d7fc4ce9015b51baca75608f57f..702d612343770b77273e019bafd590b14f7ea684 100644
--- a/indra/newview/llfloaterreporter.cpp
+++ b/indra/newview/llfloaterreporter.cpp
@@ -930,7 +930,7 @@ void LLFloaterReporter::takeNewSnapshot()
 
 	// Take a screenshot, but don't draw this floater.
 	setVisible(FALSE);
-	if( !gViewerWindow->rawSnapshot(mImageRaw, IMAGE_WIDTH, IMAGE_HEIGHT, TRUE, FALSE, TRUE, FALSE))
+    if (!gViewerWindow->rawSnapshot(mImageRaw, IMAGE_WIDTH, IMAGE_HEIGHT, TRUE, FALSE, gSavedSettings.getBOOL("RenderHUDInSnapshot"), TRUE, FALSE))
 	{
 		LL_WARNS() << "Unable to take screenshot" << LL_ENDL;
 		setVisible(TRUE);
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 7b87b432431d1862d4b9740ed560143a82827c89..e1b58dde51dce55484413a689a3291e626ffd03b 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -1606,16 +1606,17 @@ void LLIMProcessing::requestOfflineMessagesCoro(std::string url)
             bin_bucket.push_back(0);
         }
 
-        // Todo: once drtsim-451 releases, remove the string option
-        BOOL from_group;
-        if (message_data["from_group"].isInteger())
-        {
-            from_group = message_data["from_group"].asInteger();
-        }
-        else
-        {
-            from_group = message_data["from_group"].asString() == "Y";
+        // Todo: once drtsim-451 releases, remove the string option
+        BOOL from_group;
+        if (message_data["from_group"].isInteger())
+        {
+            from_group = message_data["from_group"].asInteger();
         }
+        else
+        {
+            from_group = message_data["from_group"].asString() == "Y";
+        }
+
 
         LLIMProcessing::processNewMessage(
             message_data["from_agent_id"].asUUID(),
diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp
index 9d54c8c9c5bff7f30381dfdee41c014971ce3189..0f846c152aea92cd77304c37ee667f18a51fa1b9 100644
--- a/indra/newview/lllogininstance.cpp
+++ b/indra/newview/lllogininstance.cpp
@@ -332,7 +332,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
         {
             data["certificate"] = response["certificate"];
         }
-
+        
         if (gViewerWindow)
             gViewerWindow->setShowProgress(FALSE);
 
@@ -349,31 +349,13 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
         // login.cgi is insisting on a required update. We were called with an
         // event that bundles both the login.cgi 'response' and the
         // synchronization event from the 'updater'.
-        std::string login_version = response["message_args"]["VERSION"];
-        std::string vvm_version   = updater["VERSION"];
-        std::string relnotes      = updater["URL"];
-        LL_WARNS("LLLogin") << "Login failed because an update to version " << login_version << " is required." << LL_ENDL;
-        // vvm_version might be empty because we might not have gotten
-        // SLVersionChecker's LoginSync handshake. But if it IS populated, it
-        // should (!) be the same as the version we got from login.cgi.
-        if ((! vvm_version.empty()) && vvm_version != login_version)
-        {
-            LL_WARNS("LLLogin") << "VVM update version " << vvm_version
-                                << " differs from login version " << login_version
-                                << "; presenting VVM version to match release notes URL"
-                                << LL_ENDL;
-            login_version = vvm_version;
-        }
-        if (relnotes.empty())
-        {
-            // I thought this would be available in strings.xml or some such
-            relnotes = "https://secondlife.com/support/downloads/";
-        }
+        std::string required_version = response["message_args"]["VERSION"];
+        LL_WARNS("LLLogin") << "Login failed because an update to version " << required_version << " is required." << LL_ENDL;
 
         if (gViewerWindow)
             gViewerWindow->setShowProgress(FALSE);
 
-        LLSD args(LLSDMap("VERSION", login_version)("URL", relnotes));
+        LLSD args(LLSDMap("VERSION", required_version));
         if (updater.isUndefined())
         {
             // If the updater failed to shake hands, better advise the user to
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 1fce158eb40af7b34a2dcf345afdcc675f715358..c5ced425f65ac026021a2e97f682c2f5b8942c46 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -876,7 +876,7 @@ LLMeshRepoThread::~LLMeshRepoThread()
 void LLMeshRepoThread::run()
 {
 	LLCDResult res = LLConvexDecomposition::initThread();
-	if (res != LLCD_OK)
+	if (res != LLCD_OK && LLConvexDecomposition::isFunctional())
 	{
 		LL_WARNS(LOG_MESH) << "Convex decomposition unable to be loaded.  Expect severe problems." << LL_ENDL;
 	}
@@ -1142,7 +1142,7 @@ void LLMeshRepoThread::run()
 	}
 
 	res = LLConvexDecomposition::quitThread();
-	if (res != LLCD_OK)
+	if (res != LLCD_OK && LLConvexDecomposition::isFunctional())
 	{
 		LL_WARNS(LOG_MESH) << "Convex decomposition unable to be quit." << LL_ENDL;
 	}
@@ -3470,6 +3470,11 @@ void LLMeshRepository::init()
 	
 	LLConvexDecomposition::getInstance()->initSystem();
 
+    if (!LLConvexDecomposition::isFunctional())
+    {
+        LL_INFOS(LOG_MESH) << "Using STUB for LLConvexDecomposition" << LL_ENDL;
+    }
+
 	mDecompThread = new LLPhysicsDecomp();
 	mDecompThread->start();
 
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 520c9adcd132797110aa977ab5ca6d2ba141a489..852ba846ffa321e5613d368dba0605b4b58fcb92 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -1364,6 +1364,7 @@ void LLOutfitGallery::onSelectPhoto(LLUUID selected_outfit_id)
                 texture_floaterp->setOnFloaterCommitCallback(boost::bind(&LLOutfitGallery::onTexturePickerCommit, this, _1, _2));
                 texture_floaterp->setOnUpdateImageStatsCallback(boost::bind(&LLOutfitGallery::onTexturePickerUpdateImageStats, this, _1));
                 texture_floaterp->setLocalTextureEnabled(FALSE);
+                texture_floaterp->setCanApply(false, true);
             }
 
             floaterp->openFloater();
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 70757882d8c60f6b09c081475644ec138dbab1e5..da21d5e69a694c9ea3f74caa4c300fb95dd8f1ec 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -41,7 +41,6 @@
 #include "llcommandhandler.h"		// for secondlife:///app/login/
 #include "llcombobox.h"
 #include "llviewercontrol.h"
-#include "llfloaterpreference.h"
 #include "llfocusmgr.h"
 #include "lllineeditor.h"
 #include "llnotificationsutil.h"
@@ -456,6 +455,10 @@ void LLPanelLogin::addFavoritesToStartLocation()
 		}
 		break;
 	}
+	if (combo->getValue().asString().empty())
+	{
+		combo->selectFirstItem();
+	}
 }
 
 LLPanelLogin::~LLPanelLogin()
@@ -1330,13 +1333,13 @@ void LLPanelLogin::onSelectServer()
 		{
 			std::string location = location_combo->getValue().asString();
 			LLSLURL slurl(location); // generata a slurl from the location combo contents
-			if (   slurl.getType() == LLSLURL::LOCATION
-				&& slurl.getGrid() != LLGridManager::getInstance()->getGrid()
-				)
+			if (location.empty()
+				|| (slurl.getType() == LLSLURL::LOCATION
+				    && slurl.getGrid() != LLGridManager::getInstance()->getGrid())
+				   )
 			{
 				// the grid specified by the location is not this one, so clear the combo
 				location_combo->setCurrentByIndex(0); // last location on the new grid
-				location_combo->setTextEntry(LLStringUtil::null);
 			}
 		}			
 		break;
diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp
index aa5ba3f210ea5ccef5052e366ec59db0a6b6d934..d52ad8056fc75849b1d717dfe4572a32f9891b13 100644
--- a/indra/newview/llpanelpresetspulldown.cpp
+++ b/indra/newview/llpanelpresetspulldown.cpp
@@ -33,8 +33,8 @@
 
 #include "llbutton.h"
 #include "lltabcontainer.h"
+#include "llfloater.h"
 #include "llfloaterreg.h"
-#include "llfloaterpreference.h"
 #include "llpresetsmanager.h"
 #include "llsliderctrl.h"
 #include "llscrolllistctrl.h"
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index c72a0706cdceb47a71aab25492144fd0f23b8b50..97b5b2a57dc57ef1e48b5990cc009900d6f751e7 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -329,7 +329,7 @@ void LLSettingsVOBase::onAssetDownloadComplete(LLVFS *vfs, const LLUUID &asset_i
     }
     else
     {
-        LL_WARNS("SETTINGS") << "Error retrieving asset " << asset_id << ". Status code=" << status << "(" << LLAssetStorage::getErrorString(status) << ") ext_status=" << ext_status << LL_ENDL;
+        LL_WARNS("SETTINGS") << "Error retrieving asset " << asset_id << ". Status code=" << status << "(" << LLAssetStorage::getErrorString(status) << ") ext_status=" << (U32)ext_status << LL_ENDL;
     }
     if (callback)
         callback(asset_id, settings, status, ext_status);
diff --git a/indra/newview/llsnapshotlivepreview.cpp b/indra/newview/llsnapshotlivepreview.cpp
index 356f2e81ceb17689fafed743511117f414a62ad0..f3439daee9aede33fc26af4403ececcfa60965e0 100644
--- a/indra/newview/llsnapshotlivepreview.cpp
+++ b/indra/newview/llsnapshotlivepreview.cpp
@@ -558,6 +558,7 @@ void LLSnapshotLivePreview::generateThumbnailImage(BOOL force_update)
         if(!gViewerWindow->thumbnailSnapshot(raw,
                                          mThumbnailWidth, mThumbnailHeight,
                                          mAllowRenderUI && gSavedSettings.getBOOL("RenderUIInSnapshot"),
+                                         gSavedSettings.getBOOL("RenderHUDInSnapshot"),
                                          FALSE,
                                          mSnapshotBufferType) )
         {
@@ -716,6 +717,7 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview )
                 previewp->mKeepAspectRatio,//gSavedSettings.getBOOL("KeepAspectForSnapshot"),
                 previewp->getSnapshotType() == LLSnapshotModel::SNAPSHOT_TEXTURE,
                 previewp->mAllowRenderUI && gSavedSettings.getBOOL("RenderUIInSnapshot"),
+                gSavedSettings.getBOOL("RenderHUDInSnapshot"),
                 FALSE,
                 previewp->mSnapshotBufferType,
                 previewp->getMaxImageSize()))
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 38ed022c441badad758c68816a36adb7732c1db8..6d20dcf18881b016e475a531c616298925f499f6 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -108,7 +108,6 @@
 //#include "llfirstuse.h"
 #include "llfloaterhud.h"
 #include "llfloaterland.h"
-#include "llfloaterpreference.h"
 #include "llfloatertopobjects.h"
 #include "llfloaterworldmap.h"
 #include "llgesturemgr.h"
@@ -812,6 +811,7 @@ bool idle_startup()
 		show_debug_menus();
 
 		// Hide the splash screen
+		LL_DEBUGS("AppInit") << "Hide the splash screen and show window" << LL_ENDL;
 		LLSplashScreen::hide();
 		// Push our window frontmost
 		gViewerWindow->getWindow()->show();
@@ -819,9 +819,12 @@ bool idle_startup()
 		// DEV-16927.  The following code removes errant keystrokes that happen while the window is being 
 		// first made visible.
 #ifdef _WIN32
+        LL_DEBUGS("AppInit") << "Processing PeekMessage" << LL_ENDL;
 		MSG msg;
 		while( PeekMessage( &msg, /*All hWnds owned by this thread */ NULL, WM_KEYFIRST, WM_KEYLAST, PM_REMOVE ) )
-		{ }
+        {
+        }
+        LL_DEBUGS("AppInit") << "PeekMessage processed" << LL_ENDL;
 #endif
         display_startup();
         timeout.reset();
diff --git a/indra/newview/llviewerassetstorage.cpp b/indra/newview/llviewerassetstorage.cpp
index b295fa2977c7638e708146f4d8ff593f3b2fdabf..cacdee7e83951de2ed9b709a2dab1154d40abc58 100644
--- a/indra/newview/llviewerassetstorage.cpp
+++ b/indra/newview/llviewerassetstorage.cpp
@@ -179,7 +179,7 @@ void LLViewerAssetStorage::storeAssetData(
                 delete req;
                 if (callback)
                 {
-                    callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_FAILED, LL_EXSTAT_VFS_CORRUPT);
+                    callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_FAILED, LLExtStat::VFS_CORRUPT);
                 }
                 return;
             }
@@ -220,7 +220,7 @@ void LLViewerAssetStorage::storeAssetData(
 
                     if (callback)
                     {
-                        callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE, LL_EXSTAT_VFS_CORRUPT);
+                        callback(asset_id, user_data, LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE, LLExtStat::VFS_CORRUPT);
                     }
                     return;
                 }
@@ -247,7 +247,7 @@ void LLViewerAssetStorage::storeAssetData(
             reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_ZERO_SIZE, __FILE__, __LINE__, "The file didn't exist or was zero length (VFS - can't tell which)" );
             if (callback)
             {
-                callback(asset_id, user_data,  LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE, LL_EXSTAT_NONEXISTENT_FILE);
+                callback(asset_id, user_data,  LL_ERR_ASSET_REQUEST_NONEXISTENT_FILE, LLExtStat::NONEXISTENT_FILE);
             }
         }
     }
@@ -258,7 +258,7 @@ void LLViewerAssetStorage::storeAssetData(
         reportMetric( asset_id, asset_type, LLStringUtil::null, LLUUID::null, 0, MR_NO_UPSTREAM, __FILE__, __LINE__, "No upstream provider" );
         if (callback)
         {
-            callback(asset_id, user_data, LL_ERR_CIRCUIT_GONE, LL_EXSTAT_NO_UPSTREAM);
+            callback(asset_id, user_data, LL_ERR_CIRCUIT_GONE, LLExtStat::NO_UPSTREAM);
         }
     }
 }
@@ -344,7 +344,7 @@ void LLViewerAssetStorage::storeAssetData(
         }
         if (callback)
         {
-            callback(asset_id, user_data, LL_ERR_CANNOT_OPEN_FILE, LL_EXSTAT_BLOCKED_FILE);
+            callback(asset_id, user_data, LL_ERR_CANNOT_OPEN_FILE, LLExtStat::BLOCKED_FILE);
         }
     }
 }
@@ -455,13 +455,18 @@ void LLViewerAssetStorage::assetRequestCoro(
     mCountStarted++;
     
     S32 result_code = LL_ERR_NOERR;
-    LLExtStat ext_status = LL_EXSTAT_NONE;
+    LLExtStat ext_status = LLExtStat::NONE;
 
+    if (!gAssetStorage)
+    {
+        LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: asset storage no longer exists" << LL_ENDL;
+        return;
+    }
     if (!gAgent.getRegion())
     {
         LL_WARNS_ONCE("ViewerAsset") << "Asset request fails: no region set" << LL_ENDL;
         result_code = LL_ERR_ASSET_REQUEST_FAILED;
-        ext_status = LL_EXSTAT_NONE;
+        ext_status = LLExtStat::NONE;
         removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status);
 		return;
     }
@@ -486,7 +491,7 @@ void LLViewerAssetStorage::assetRequestCoro(
     {
         LL_WARNS_ONCE("ViewerAsset") << "asset request fails: caps received but no viewer asset cap found" << LL_ENDL;
         result_code = LL_ERR_ASSET_REQUEST_FAILED;
-        ext_status = LL_EXSTAT_NONE;
+        ext_status = LLExtStat::NONE;
         removeAndCallbackPendingDownloads(uuid, atype, uuid, atype, result_code, ext_status);
 		return;
     }
@@ -501,7 +506,7 @@ void LLViewerAssetStorage::assetRequestCoro(
 
     LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts);
 
-    if (LLApp::isQuitting())
+    if (LLApp::isQuitting() || !gAssetStorage)
     {
         // Bail out if result arrives after shutdown has been started.
         return;
@@ -515,7 +520,7 @@ void LLViewerAssetStorage::assetRequestCoro(
     {
         LL_DEBUGS("ViewerAsset") << "request failed, status " << status.toTerseString() << LL_ENDL;
         result_code = LL_ERR_ASSET_REQUEST_FAILED;
-        ext_status = LL_EXSTAT_NONE;
+        ext_status = LLExtStat::NONE;
     }
     else
     {
@@ -541,13 +546,13 @@ void LLViewerAssetStorage::assetRequestCoro(
                 // TODO asset-http: handle error
                 LL_WARNS("ViewerAsset") << "Failure in vf.write()" << LL_ENDL;
                 result_code = LL_ERR_ASSET_REQUEST_FAILED;
-                ext_status = LL_EXSTAT_VFS_CORRUPT;
+                ext_status = LLExtStat::VFS_CORRUPT;
             }
             else if (!vf.rename(uuid, atype))
             {
                 LL_WARNS("ViewerAsset") << "rename failed" << LL_ENDL;
                 result_code = LL_ERR_ASSET_REQUEST_FAILED;
-                ext_status = LL_EXSTAT_VFS_CORRUPT;
+                ext_status = LLExtStat::VFS_CORRUPT;
             }
             else
             {
@@ -559,7 +564,7 @@ void LLViewerAssetStorage::assetRequestCoro(
             // TODO asset-http: handle invalid size case
 			LL_WARNS("ViewerAsset") << "bad size" << LL_ENDL;
             result_code = LL_ERR_ASSET_REQUEST_FAILED;
-            ext_status = LL_EXSTAT_NONE;
+            ext_status = LLExtStat::NONE;
         }
     }
 
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 2b1f4b138fc4749d8afe32c4ab557dac36291090..f025863072df5c4f058f529b9f51c7284beeb96a 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -151,6 +151,10 @@ void display_startup()
 	{
 		LLViewerDynamicTexture::updateAllInstances();
 	}
+    else
+    {
+        LL_DEBUGS("Window") << "First display_startup frame" << LL_ENDL;
+    }
 
 	LLGLState::checkStates();
 	LLGLState::checkTextureChannels();
@@ -253,6 +257,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
 
 	if (gWindowResized)
 	{ //skip render on frames where window has been resized
+		LL_DEBUGS("Window") << "Resizing window" << LL_ENDL;
 		LL_RECORD_BLOCK_TIME(FTM_RESIZE_WINDOW);
 		gGL.flush();
 		glClear(GL_COLOR_BUFFER_BIT);
diff --git a/indra/newview/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp
index 3d06c9508086902aadebeb614ce3263cbaf11c60..491ad7e3b2c719790b295cebca685c6f00021e0c 100644
--- a/indra/newview/llviewerjoystick.cpp
+++ b/indra/newview/llviewerjoystick.cpp
@@ -309,10 +309,13 @@ void LLViewerJoystick::init(bool autoenable)
 void LLViewerJoystick::terminate()
 {
 #if LIB_NDOF
-
-	ndof_libcleanup();
-	LL_INFOS("joystick") << "Terminated connection with NDOF device." << LL_ENDL;
-	mDriverState = JDS_UNINITIALIZED;
+    if (mNdofDev != NULL)
+    {
+        ndof_libcleanup(); // frees alocated memory in mNdofDev
+        mDriverState = JDS_UNINITIALIZED;
+        mNdofDev = NULL;
+        LL_INFOS("joystick") << "Terminated connection with NDOF device." << LL_ENDL;
+    }
 #endif
 }
 
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index e31dfb29c722cd358fae2a118568aff83ce06ca6..c36d877a59060f1e7fc135d5c90e1018781ef1b3 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -1026,7 +1026,7 @@ void LLViewerMedia::setAllMediaPaused(bool val)
     {
         if (!LLViewerMedia::isParcelMediaPlaying() && LLViewerMedia::hasParcelMedia())
         {
-            LLViewerParcelMedia::getInstance()->play(LLViewerParcelMgr::getInstance()->getAgentParcel());
+            LLViewerParcelMedia::getInstance()->play(agent_parcel);
         }
 
         static LLCachedControl<bool> audio_streaming_music(gSavedSettings, "AudioStreamingMusic", true);
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 512c5a827992dca4d376b82f96362210b61fa408..8bf1ad2441632294890c71069eae2228499643aa 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -79,7 +79,7 @@ class LLViewerMedia: public LLSingleton<LLViewerMedia>
 
 public:
 	// String to get/set media autoplay in gSavedSettings
-    static const char* AUTO_PLAY_MEDIA_SETTING;
+	static const char* AUTO_PLAY_MEDIA_SETTING;
 	static const char* SHOW_MEDIA_ON_OTHERS_SETTING;
 	static const char* SHOW_MEDIA_WITHIN_PARCEL_SETTING;
 	static const char* SHOW_MEDIA_OUTSIDE_PARCEL_SETTING;
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index d1d3a7fc1205a77bfb6563192e581966ee6b110c..cd48b1e8e7d8b470469ef76ecde7f775e5ab1c72 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -683,10 +683,16 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
 		S32 width = gViewerWindow->getWindowWidthRaw();
 		S32 height = gViewerWindow->getWindowHeightRaw();
 
+		bool render_ui = gSavedSettings.getBOOL("RenderUIInSnapshot");
+		bool render_hud = gSavedSettings.getBOOL("RenderHUDInSnapshot");
+
 		if (gSavedSettings.getBOOL("HighResSnapshot"))
 		{
 			width *= 2;
 			height *= 2;
+			// not compatible wirh UI/HUD
+			render_ui = false;
+			render_hud = false;
 		}
 
 		if (gViewerWindow->rawSnapshot(raw,
@@ -694,7 +700,8 @@ class LLFileTakeSnapshotToDisk : public view_listener_t
 									   height,
 									   TRUE,
 									   FALSE,
-									   gSavedSettings.getBOOL("RenderUIInSnapshot"),
+									   render_ui,
+									   render_hud,
 									   FALSE))
 		{
 			LLPointer<LLImageFormatted> formatted;
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index e07762646180211cf9415a085c0965c5a95f59b2..06a8ebbe895ada2063220ee40ffe6faba973e4b2 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -5102,7 +5102,14 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
 			std::string snap_filename = gDirUtilp->getLindenUserDir();
 			snap_filename += gDirUtilp->getDirDelimiter();
 			snap_filename += LLStartUp::getScreenHomeFilename();
-			gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG);
+            gViewerWindow->saveSnapshot(snap_filename,
+                                        gViewerWindow->getWindowWidthRaw(),
+                                        gViewerWindow->getWindowHeightRaw(),
+                                        FALSE, //UI
+                                        gSavedSettings.getBOOL("RenderHUDInSnapshot"),
+                                        FALSE,
+                                        LLSnapshotModel::SNAPSHOT_TYPE_COLOR,
+                                        LLSnapshotModel::SNAPSHOT_FORMAT_PNG);
 		}
 		
 		if (notificationID == "RegionRestartMinutes" ||
@@ -5200,7 +5207,14 @@ static void process_special_alert_messages(const std::string & message)
 		std::string snap_filename = gDirUtilp->getLindenUserDir();
 		snap_filename += gDirUtilp->getDirDelimiter();
 		snap_filename += LLStartUp::getScreenHomeFilename();
-		gViewerWindow->saveSnapshot(snap_filename, gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw(), FALSE, FALSE, LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::SNAPSHOT_FORMAT_PNG);
+		gViewerWindow->saveSnapshot(snap_filename,
+                                    gViewerWindow->getWindowWidthRaw(),
+                                    gViewerWindow->getWindowHeightRaw(),
+                                    FALSE,
+                                    gSavedSettings.getBOOL("RenderHUDInSnapshot"),
+                                    FALSE,
+                                    LLSnapshotModel::SNAPSHOT_TYPE_COLOR,
+                                    LLSnapshotModel::SNAPSHOT_FORMAT_PNG);
 	}
 }
 
diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp
index fe3e4cdd617132e2dfdaa9be12f66c790d1954e8..9c91cde09a22468964e811104d8d1b6188e096b7 100644
--- a/indra/newview/llviewerobject.cpp
+++ b/indra/newview/llviewerobject.cpp
@@ -4800,7 +4800,9 @@ LLViewerTexture* LLViewerObject::getBakedTextureForMagicId(const LLUUID& id)
 	}
 
 	LLVOAvatar* avatar = getAvatar();
-	if (avatar)
+	if (avatar && !isHUDAttachment()
+		&& isMesh()
+		&& getVolume() && getVolume()->getParams().getSculptID().notNull()) // checking for the rigged mesh by params instead of using isRiggedMesh() to avoid false negatives when skin info isn't ready
 	{
 		LLAvatarAppearanceDefines::EBakedTextureIndex texIndex = LLAvatarAppearanceDefines::LLAvatarAppearanceDictionary::assetIdToBakedTextureIndex(id);
 		LLViewerTexture* bakedTexture = avatar->getBakedTexture(texIndex);
diff --git a/indra/newview/llviewerparcelaskplay.cpp b/indra/newview/llviewerparcelaskplay.cpp
index d4aa783f120a08bc084e5f84ed4929a4ce307626..74586dadc30c416d2665d78a21e25f0683b4d2e2 100644
--- a/indra/newview/llviewerparcelaskplay.cpp
+++ b/indra/newview/llviewerparcelaskplay.cpp
@@ -78,6 +78,8 @@ void LLViewerParcelAskPlay::askToPlay(const LLUUID &region_id, const S32 &parcel
     default:
         {
             // create or re-create notification
+            // Note: will create and immediately cancel one notification if region has both media and music
+            // since ask play does not distinguish media from music and media can be used as music
             cancelNotification();
 
             if (LLStartUp::getStartupState() > STATE_PRECACHE)
diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp
index 0cdd447fcd26593ecf592e1c4c80c5d2640ae5ee..83b05e6b4d2e1c0ecc26911df38643d3ea2f0a43 100644
--- a/indra/newview/llviewerparcelmedia.cpp
+++ b/indra/newview/llviewerparcelmedia.cpp
@@ -52,6 +52,10 @@ mMediaParcelLocalID(0)
 	LLMessageSystem* msg = gMessageSystem;
 	msg->setHandlerFunc("ParcelMediaCommandMessage", parcelMediaCommandMessageHandler );
 	msg->setHandlerFunc("ParcelMediaUpdate", parcelMediaUpdateHandler );
+
+    // LLViewerParcelMediaAutoPlay will regularly check and autoplay media,
+    // might be good idea to just integrate it into LLViewerParcelMedia
+    LLSingleton<LLViewerParcelMediaAutoPlay>::getInstance();
 }
 
 LLViewerParcelMedia::~LLViewerParcelMedia()
@@ -80,11 +84,13 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
 			S32 parcelid = parcel->getLocalID();						
 
 			LLUUID regionid = gAgent.getRegion()->getRegionID();
+			bool location_changed = false;
 			if (parcelid != mMediaParcelLocalID || regionid != mMediaRegionID)
 			{
 				LL_DEBUGS("Media") << "New parcel, parcel id = " << parcelid << ", region id = " << regionid << LL_ENDL;
 				mMediaParcelLocalID = parcelid;
 				mMediaRegionID = regionid;
+				location_changed = true;
 			}
 
 			std::string mediaUrl = std::string ( parcel->getMediaURL () );
@@ -102,7 +108,7 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
 			if(mMediaImpl.isNull())
 
 			{
-				play(parcel);
+				// media will be autoplayed by LLViewerParcelMediaAutoPlay
 				return;
 			}
 
@@ -111,8 +117,9 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
 				|| ( mMediaImpl->getMediaTextureID() != parcel->getMediaID() )
 				|| ( mMediaImpl->getMimeType() != parcel->getMediaType() ))
 			{
-				// Only play if the media types are the same.
-				if(mMediaImpl->getMimeType() == parcel->getMediaType())
+				// Only play if the media types are the same and parcel stays same.
+				if(mMediaImpl->getMimeType() == parcel->getMediaType()
+					&& !location_changed)
 				{
 					play(parcel);
 				}
@@ -128,25 +135,6 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
 			stop();
 		}
 	}
-	/*
-	else
-	{
-		// no audio player, do a first use dialog if there is media here
-		if (parcel)
-		{
-			std::string mediaUrl = std::string ( parcel->getMediaURL () );
-			if (!mediaUrl.empty ())
-			{
-				if (gWarningSettings.getBOOL("QuickTimeInstalled"))
-				{
-					gWarningSettings.setBOOL("QuickTimeInstalled", FALSE);
-
-					LLNotificationsUtil::add("NoQuickTime" );
-				};
-			}
-		}
-	}
-	*/
 }
 
 // static
@@ -159,12 +147,6 @@ void LLViewerParcelMedia::play(LLParcel* parcel)
 	if (!gSavedSettings.getBOOL("AudioStreamingMedia"))
 		return;
 
-	// This test appears all over the code and really should be facotred out into a single 
-	// call that returns true/false (with option ask dialog) but that is outside of scope
-	// for this work so we'll just directly.
-	if (gSavedSettings.getS32("ParcelMediaAutoPlayEnable") == 0 )
-		return;
-
 	std::string media_url = parcel->getMediaURL();
 	std::string media_current_url = parcel->getMediaCurrentURL();
 	std::string mime_type = parcel->getMediaType();
diff --git a/indra/newview/llviewerparcelmediaautoplay.cpp b/indra/newview/llviewerparcelmediaautoplay.cpp
index 36c7d436f6abaa131b9a9f1c89d7548ba95cf43e..db8fcb4dc48a3866acec54a594f6e541a51d8eeb 100644
--- a/indra/newview/llviewerparcelmediaautoplay.cpp
+++ b/indra/newview/llviewerparcelmediaautoplay.cpp
@@ -143,7 +143,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick()
 								LLViewerParcelAskPlay::getInstance()->askToPlay(this_region->getRegionID(),
 																				this_parcel->getLocalID(),
 																				this_parcel->getMediaURL(),
-																				onStartMusicResponse);
+																				onStartMediaResponse);
 								break;
   							}
   						}
@@ -160,7 +160,7 @@ BOOL LLViewerParcelMediaAutoPlay::tick()
 }
 
 //static
-void LLViewerParcelMediaAutoPlay::onStartMusicResponse(const LLUUID &region_id, const S32 &parcel_id, const std::string &url, const bool &play)
+void LLViewerParcelMediaAutoPlay::onStartMediaResponse(const LLUUID &region_id, const S32 &parcel_id, const std::string &url, const bool &play)
 {
     if (play)
     {
diff --git a/indra/newview/llviewerparcelmediaautoplay.h b/indra/newview/llviewerparcelmediaautoplay.h
index cf8e9a97e76149346c1ab932bf930a795de9b40d..d71fd4c07508a8d4c49a7e62e07009138d85d2e7 100644
--- a/indra/newview/llviewerparcelmediaautoplay.h
+++ b/indra/newview/llviewerparcelmediaautoplay.h
@@ -39,7 +39,8 @@ class LLViewerParcelMediaAutoPlay : LLEventTimer, public LLSingleton<LLViewerPar
 	static void playStarted();
 
  private:
-	static void onStartMusicResponse(const LLUUID &region_id, const S32 &parcel_id, const std::string &url, const bool &play);
+    // for askToPlay
+	static void onStartMediaResponse(const LLUUID &region_id, const S32 &parcel_id, const std::string &url, const bool &play);
 
  private:
 	S32 mLastParcelID;
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index 0f5893300595ac983eaa1e83f703ac27980db3dd..f7ded003186a8e6fafca9e89c0c28abd602ede3f 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -55,7 +55,6 @@
 #include "llviewerregion.h"
 #include "llvoavatar.h"
 #include "llvoavatarself.h"
-#include "llviewerwindow.h"		// *TODO: remove, only used for width/height
 #include "llworld.h"
 #include "llfeaturemanager.h"
 #include "llviewernetwork.h"
@@ -582,21 +581,38 @@ void send_stats()
 	// If the current revision is recent, ping the previous author before overriding
 	LLSD &misc = body["stats"]["misc"];
 
-	// Screen size so the UI team can figure out how big the widgets
-	// appear and use a "typical" size for end user tests.
-
-	S32 window_width = gViewerWindow->getWindowWidthRaw();
-	S32 window_height = gViewerWindow->getWindowHeightRaw();
-	S32 window_size = (window_width * window_height) / 1024;
-	misc["string_1"] = llformat("%d", window_size);
-	misc["string_2"] = llformat("Texture Time: %.2f, Total Time: %.2f", gTextureTimer.getElapsedTimeF32(), gFrameTimeSeconds.value());
-
-	F32 unbaked_time = LLVOAvatar::sUnbakedTime * 1000.f / gFrameTimeSeconds;
-	misc["int_1"] = LLSD::Integer(unbaked_time); // Steve: 1.22
-	F32 grey_time = LLVOAvatar::sGreyTime * 1000.f / gFrameTimeSeconds;
-	misc["int_2"] = LLSD::Integer(grey_time); // Steve: 1.22
-
-	LL_INFOS() << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << LL_ENDL;
+#ifdef LL_WINDOWS
+    // Probe for Vulkan capability (Dave Houlton 05/2020)
+    //
+    // Check for presense of a Vulkan loader dll, as a proxy for a Vulkan-capable gpu.
+    // False-positives and false-negatives are possible, but unlikely. We'll get a good
+    // approximation of Vulkan capability within current user systems from this. More
+    // detailed information on versions and extensions can come later.
+    static bool vulkan_oneshot = false;
+    static bool vulkan_detected = false;
+
+    if (!vulkan_oneshot)
+    {
+        HMODULE vulkan_loader = LoadLibraryExA("vulkan-1.dll", NULL, LOAD_LIBRARY_AS_DATAFILE);
+        if (NULL != vulkan_loader)
+        {
+            vulkan_detected = true;
+            FreeLibrary(vulkan_loader);
+        }
+        vulkan_oneshot = true;
+    }
+
+    misc["string_1"] = vulkan_detected ? llformat("Vulkan driver is detected") : llformat("No Vulkan driver detected");
+
+#else
+    misc["string_1"] = llformat("Unused");
+#endif // LL_WINDOWS
+
+    misc["string_2"] = llformat("Unused");
+    misc["int_1"] = LLSD::Integer(0);
+    misc["int_2"] = LLSD::Integer(0);
+
+    LL_INFOS() << "Misc Stats: int_1: " << misc["int_1"] << " int_2: " << misc["int_2"] << LL_ENDL;
 	LL_INFOS() << "Misc Stats: string_1: " << misc["string_1"] << " string_2: " << misc["string_2"] << LL_ENDL;
 
 	body["DisplayNamesEnabled"] = gSavedSettings.getBOOL("UseDisplayNames");
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 5dd3270b2e520e1227acec09dcfbd91ae12c5e84..0cc1e0df06aaf1c95aae7d801199ece5397c7d0e 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -4592,12 +4592,12 @@ void LLViewerWindow::movieSize(S32 new_width, S32 new_height)
 	}
 }
 
-BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, LLSnapshotModel::ESnapshotFormat format)
+BOOL LLViewerWindow::saveSnapshot(const std::string& filepath, S32 image_width, S32 image_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, LLSnapshotModel::ESnapshotFormat format)
 {
     LL_INFOS() << "Saving snapshot to: " << filepath << LL_ENDL;
 
     LLPointer<LLImageRaw> raw = new LLImageRaw;
-    BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, do_rebuild);
+    BOOL success = rawSnapshot(raw, image_width, image_height, TRUE, FALSE, show_ui, show_hud, do_rebuild);
 
     if (success)
     {
@@ -4656,16 +4656,16 @@ void LLViewerWindow::resetSnapshotLoc() const
 	gSavedPerAccountSettings.setString("SnapshotBaseDir", std::string());
 }
 
-BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type)
+BOOL LLViewerWindow::thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type)
 {
-	return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, do_rebuild, type);
+	return rawSnapshot(raw, preview_width, preview_height, FALSE, FALSE, show_ui, show_hud, do_rebuild, type);
 }
 
 // Saves the image from the screen to a raw image
 // Since the required size might be bigger than the available screen, this method rerenders the scene in parts (called subimages) and copy
 // the results over to the final raw image.
 BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, 
-	BOOL keep_window_aspect, BOOL is_texture, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, S32 max_size)
+    BOOL keep_window_aspect, BOOL is_texture, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type, S32 max_size)
 {
 	if (!raw)
 	{
@@ -4699,7 +4699,7 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei
 		LLPipeline::toggleRenderDebugFeature(LLPipeline::RENDER_DEBUG_FEATURE_UI);
 	}
 
-	BOOL hide_hud = !gSavedSettings.getBOOL("RenderHUDInSnapshot") && LLPipeline::sShowHUDAttachments;
+    BOOL hide_hud = !show_hud && LLPipeline::sShowHUDAttachments;
 	if (hide_hud)
 	{
 		LLPipeline::sShowHUDAttachments = FALSE;
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 44c1fbd066a2ca4e58af80f5f41680ef4727e164..e901245f928424510fb27f0fb2bc4fe2e2ea7116 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -353,10 +353,10 @@ class LLViewerWindow : public LLWindowCallbacks
 	// snapshot functionality.
 	// perhaps some of this should move to llfloatershapshot?  -MG
 
-	BOOL			saveSnapshot(const std::string&  filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::ESnapshotFormat format = LLSnapshotModel::SNAPSHOT_FORMAT_BMP);
+	BOOL			saveSnapshot(const std::string&  filename, S32 image_width, S32 image_height, BOOL show_ui = TRUE, BOOL show_hud = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, LLSnapshotModel::ESnapshotFormat format = LLSnapshotModel::SNAPSHOT_FORMAT_BMP);
 	BOOL			rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_height, BOOL keep_window_aspect = TRUE, BOOL is_texture = FALSE,
-		BOOL show_ui = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE);
-	BOOL			thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type);
+		BOOL show_ui = TRUE, BOOL show_hud = TRUE, BOOL do_rebuild = FALSE, LLSnapshotModel::ESnapshotLayerType type = LLSnapshotModel::SNAPSHOT_TYPE_COLOR, S32 max_size = MAX_SNAPSHOT_IMAGE_SIZE);
+	BOOL			thumbnailSnapshot(LLImageRaw *raw, S32 preview_width, S32 preview_height, BOOL show_ui, BOOL show_hud, BOOL do_rebuild, LLSnapshotModel::ESnapshotLayerType type);
 	BOOL			isSnapshotLocSet() const;
 	void			resetSnapshotLoc() const;
 
diff --git a/indra/newview/llviewerwindowlistener.cpp b/indra/newview/llviewerwindowlistener.cpp
index 97b405c1d0943ed0f61f0cf72d79ba00e12f8bf1..acf25b9792fc4cfc3636b051fac07d34972c2b8c 100644
--- a/indra/newview/llviewerwindowlistener.cpp
+++ b/indra/newview/llviewerwindowlistener.cpp
@@ -50,10 +50,11 @@ LLViewerWindowListener::LLViewerWindowListener(LLViewerWindow* llviewerwindow):
 //  saveSnapshotArgs["width"] = LLSD::Integer();
 //  saveSnapshotArgs["height"] = LLSD::Integer();
 //  saveSnapshotArgs["showui"] = LLSD::Boolean();
+//  saveSnapshotArgs["showhud"] = LLSD::Boolean();
 //  saveSnapshotArgs["rebuild"] = LLSD::Boolean();
 //  saveSnapshotArgs["type"] = LLSD::String();
     add("saveSnapshot",
-        "Save screenshot: [\"filename\"], [\"width\"], [\"height\"], [\"showui\"], [\"rebuild\"], [\"type\"]\n"
+        "Save screenshot: [\"filename\"], [\"width\"], [\"height\"], [\"showui\"], [\"showhud\"], [\"rebuild\"], [\"type\"]\n"
         "type: \"COLOR\", \"DEPTH\"\n"
         "Post on [\"reply\"] an event containing [\"ok\"]",
         &LLViewerWindowListener::saveSnapshot,
@@ -83,6 +84,9 @@ void LLViewerWindowListener::saveSnapshot(const LLSD& event) const
     bool showui = true;
     if (event.has("showui"))
         showui = event["showui"].asBoolean();
+    bool showhud = true;
+    if (event.has("showhud"))
+        showhud = event["showhud"].asBoolean();
     bool rebuild(event["rebuild"]); // defaults to false
     LLSnapshotModel::ESnapshotLayerType type(LLSnapshotModel::SNAPSHOT_TYPE_COLOR);
     if (event.has("type"))
@@ -96,7 +100,7 @@ void LLViewerWindowListener::saveSnapshot(const LLSD& event) const
         }
         type = found->second;
     }
-    bool ok = mViewerWindow->saveSnapshot(event["filename"], width, height, showui, rebuild, type);
+    bool ok = mViewerWindow->saveSnapshot(event["filename"], width, height, showui, showhud, rebuild, type);
     sendReply(LLSDMap("ok", ok), event);
 }
 
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index f6669c44e53aac4a8df922a592188c2c1250e8d1..98eb2d3cdc69c8a57ac20df46b03a673f29c4398 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -261,7 +261,10 @@ void LLVOVolume::markDead()
 {
 	if (!mDead)
 	{
-		LLSculptIDSize::instance().rem(getVolume()->getParams().getSculptID());
+        if (getVolume())
+        {
+            LLSculptIDSize::instance().rem(getVolume()->getParams().getSculptID());
+        }
 
 		if(getMDCImplCount() > 0)
 		{
diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp
index 663a75156f03e745be87a7e738daf7aa47e611f6..bae615232e3629e74e00d800c3a31156e8d2b3fd 100644
--- a/indra/newview/llxmlrpclistener.cpp
+++ b/indra/newview/llxmlrpclistener.cpp
@@ -101,7 +101,7 @@ class CURLcodeMapper: public StatusMapperBase<CURLcode>
     {
         // from curl.h
 // skip the "CURLE_" prefix for each of these strings
-#define def(sym) (mMap[sym] = #sym + 6)
+#define def(sym) (mMap[sym] = &#sym[6])
         def(CURLE_OK);
         def(CURLE_UNSUPPORTED_PROTOCOL);    /* 1 */
         def(CURLE_FAILED_INIT);             /* 2 */
diff --git a/indra/newview/skins/default/textures/windows/login_sl_logo.png b/indra/newview/skins/default/textures/windows/login_sl_logo.png
index 9810d002377c25d0d9fbd8902f7d636855c00e7a..1eede80c83a61c71b581f47b9beafea1479be860 100644
Binary files a/indra/newview/skins/default/textures/windows/login_sl_logo.png and b/indra/newview/skins/default/textures/windows/login_sl_logo.png differ
diff --git a/indra/newview/skins/default/textures/windows/login_sl_logo_small.png b/indra/newview/skins/default/textures/windows/login_sl_logo_small.png
index 0a245442d5c50ad011dd678b86ba2ec9c6236a38..c5933001f0000473092eadcaa4bdad5d594cb392 100644
Binary files a/indra/newview/skins/default/textures/windows/login_sl_logo_small.png and b/indra/newview/skins/default/textures/windows/login_sl_logo_small.png differ
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index 05fd1947fe94cf6d2859ed68f5baf82c688f18ae..32ae56e3afa4dc7b31fd2c5f969dab9a80872a57 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -4016,8 +4016,6 @@ Finished download of raw terrain file to:
 [DOWNLOAD_PATH].
   </notification>
 
-  <!-- RequiredUpdate does not display release notes URL because we don't get
-       that from login.cgi's login failure message. -->
   <notification
    icon="alertmodal.tga"
    name="RequiredUpdate"
@@ -4035,7 +4033,6 @@ Please download from https://secondlife.com/support/downloads/
    name="PauseForUpdate"
    type="alertmodal">
 Version [VERSION] is required for login.
-Release notes: [URL]
 Click OK to download and install.
     <tag>confirm</tag>
     <usetemplate
@@ -4048,7 +4045,6 @@ Click OK to download and install.
    name="OptionalUpdateReady"
    type="alertmodal">
 Version [VERSION] has been downloaded and is ready to install.
-Release notes: [URL]
 Click OK to install.
     <tag>confirm</tag>
     <usetemplate
@@ -4061,7 +4057,6 @@ Click OK to install.
    name="PromptOptionalUpdate"
    type="alertmodal">
 Version [VERSION] has been downloaded and is ready to install.
-Release notes: [URL]
 Proceed?
     <tag>confirm</tag>
     <usetemplate
@@ -7209,12 +7204,14 @@ You can only claim public land in the Region you&apos;re in.
   </notification>
 
   <notification
-   icon="notify.tga"
+   icon="alertmodal.tga"
    name="RegionTPAccessBlocked"
-   persist="false"
-   type="notify">
+   type="alertmodal">
    <tag>fail</tag>
     The region you're trying to visit contains content exceeding your current preferences.  You can change your preferences using Me &gt; Preferences &gt; General.
+   <usetemplate
+      name="okbutton"
+      yestext="OK"/>
   </notification>
 
   <notification