diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index ae4f4d810f0a9e12f22eb69aab1c0b4409080529..707edaa3d67507dfa222d97e0614c8a2219a7479 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -626,7 +626,11 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 			}
 			else if(message_name == "cleanup")
 			{
-				// TODO: clean up here
+				// DTOR most likely won't be called but the recent change to the way this process
+				// is (not) killed means we see this message and can do what we need to here.
+				// Note: this cleanup is ultimately what writes cookies to the disk
+				LLQtWebKit::getInstance()->remObserver( mBrowserWindowId, this );
+				LLQtWebKit::getInstance()->reset();
 			}
 			else if(message_name == "shm_added")
 			{
@@ -635,7 +639,6 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
 				info.mSize = (size_t)message_in.getValueS32("size");
 				std::string name = message_in.getValue("name");
 				
-				
 //				std::cerr << "MediaPluginWebKit::receiveMessage: shared memory added, name: " << name 
 //					<< ", size: " << info.mSize 
 //					<< ", address: " << info.mAddress 
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 492d70a956cadea81b7aa14153c4a2440da1534f..293faa7b709da78fcfb5b43fc0bc390815bd987b 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1780,6 +1780,7 @@ if (WINDOWS)
     qtnetworkd4.dll
     qtopengld4.dll
     qtwebkitd4.dll
+    qtxmlpatternsd4.dll
     ssleay32.dll
     )
   copy_if_different(
@@ -1799,6 +1800,7 @@ if (WINDOWS)
     qtnetwork4.dll
     qtopengl4.dll
     qtwebkit4.dll
+    qtxmlpatterns4.dll    
     ssleay32.dll
     )
   copy_if_different(
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index ff569ecffa0d49d3e1a680b2fd6c3efa9e5ef44a..578f8fd4f0e2ac575e8a7d21f194d929210a1fc8 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -5470,6 +5470,17 @@
       <string>U32</string>
       <key>Value</key>
 	  <integer>13</integer>
+    </map>
+	<key>PrimMediaMasterEnabled</key>
+	<map>
+	  <key>Comment</key>
+      <string>Whether or not Media on a Prim is enabled.</string>
+      <key>Persist</key>
+      <integer>1</integer>
+      <key>Type</key>
+      <string>Boolean</string>
+      <key>Value</key>
+      <integer>1</integer>
     </map>
 	<key>PrimMediaControlsUseHoverControlSet</key>
 	<map>
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index d24edacd1314699312d98dfd76a23ebd50ef00b2..f98aa361e045d92ebbffd1f92e5d61e017493231 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -204,8 +204,8 @@ void LLVOVolume::markDead()
 	if (!mDead)
 	{
 		LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false);
-		sObjectMediaClient->removeFromQueue(obj);
-		sObjectMediaNavigateClient->removeFromQueue(obj);
+		if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj);
+		if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj);
 		
 		// Detach all media impls from this object
 		for(U32 i = 0 ; i < mMediaImplList.size() ; i++)
@@ -222,15 +222,18 @@ void LLVOVolume::markDead()
 void LLVOVolume::initClass()
 {
 	// gSavedSettings better be around
-	const F32 queue_timer_delay = gSavedSettings.getF32("PrimMediaRequestQueueDelay");
-	const F32 retry_timer_delay = gSavedSettings.getF32("PrimMediaRetryTimerDelay");
-	const U32 max_retries = gSavedSettings.getU32("PrimMediaMaxRetries");
-	const U32 max_sorted_queue_size = gSavedSettings.getU32("PrimMediaMaxSortedQueueSize");
-	const U32 max_round_robin_queue_size = gSavedSettings.getU32("PrimMediaMaxRoundRobinQueueSize");
-    sObjectMediaClient = new LLObjectMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries, 
-													 max_sorted_queue_size, max_round_robin_queue_size);
-    sObjectMediaNavigateClient = new LLObjectMediaNavigateClient(queue_timer_delay, retry_timer_delay, 
-																 max_retries, max_sorted_queue_size, max_round_robin_queue_size);
+	if (gSavedSettings.getBOOL("PrimMediaMasterEnabled"))
+	{
+		const F32 queue_timer_delay = gSavedSettings.getF32("PrimMediaRequestQueueDelay");
+		const F32 retry_timer_delay = gSavedSettings.getF32("PrimMediaRetryTimerDelay");
+		const U32 max_retries = gSavedSettings.getU32("PrimMediaMaxRetries");
+		const U32 max_sorted_queue_size = gSavedSettings.getU32("PrimMediaMaxSortedQueueSize");
+		const U32 max_round_robin_queue_size = gSavedSettings.getU32("PrimMediaMaxRoundRobinQueueSize");
+		sObjectMediaClient = new LLObjectMediaDataClient(queue_timer_delay, retry_timer_delay, max_retries, 
+														 max_sorted_queue_size, max_round_robin_queue_size);
+		sObjectMediaNavigateClient = new LLObjectMediaNavigateClient(queue_timer_delay, retry_timer_delay, 
+																	 max_retries, max_sorted_queue_size, max_round_robin_queue_size);
+	}
 }
 
 // static
@@ -1719,14 +1722,15 @@ LLVector3 LLVOVolume::getApproximateFaceNormal(U8 face_id)
 
 void LLVOVolume::requestMediaDataUpdate(bool isNew)
 {
-    sObjectMediaClient->fetchMedia(new LLMediaDataClientObjectImpl(this, isNew));
+    if (sObjectMediaClient)
+		sObjectMediaClient->fetchMedia(new LLMediaDataClientObjectImpl(this, isNew));
 }
 
 bool LLVOVolume::isMediaDataBeingFetched() const
 {
 	// I know what I'm doing by const_casting this away: this is just 
 	// a wrapper class that is only going to do a lookup.
-	return sObjectMediaClient->isInQueue(new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false));
+	return (sObjectMediaClient) ? sObjectMediaClient->isInQueue(new LLMediaDataClientObjectImpl(const_cast<LLVOVolume*>(this), false)) : false;
 }
 
 void LLVOVolume::cleanUpMediaImpls()
@@ -1925,7 +1929,7 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu
 		// "bounce back" to the current URL from the media entry
 		mediaNavigateBounceBack(face_index);
 	}
-	else
+	else if (sObjectMediaNavigateClient)
 	{
 		
 		llinfos << "broadcasting navigate with URI " << new_location << llendl;
@@ -1994,7 +1998,8 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin,
 
 void LLVOVolume::sendMediaDataUpdate()
 {
-    sObjectMediaClient->updateMedia(new LLMediaDataClientObjectImpl(this, false));
+    if (sObjectMediaClient)
+		sObjectMediaClient->updateMedia(new LLMediaDataClientObjectImpl(this, false));
 }
 
 void LLVOVolume::removeMediaImpl(S32 texture_index)
diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py
index 32fdd41be2cdd6a7355f80700647a3ae56552cfb..d6d6aa48d1e9e520dfcb72c1db877f1af2dbfdf9 100755
--- a/indra/newview/viewer_manifest.py
+++ b/indra/newview/viewer_manifest.py
@@ -324,6 +324,7 @@ def construct(self):
             self.path("qtnetwork4.dll")
             self.path("qtopengl4.dll")
             self.path("qtwebkit4.dll")
+            self.path("qtxmlpatterns4.dll")
             self.path("ssleay32.dll")
             self.end_prefix()
 
diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt
index 20ae1be1a2bc3ed08fca013a738b7703a9152e7a..89e2d8582d01d39df5e62e9d30338f66e2b8e256 100644
--- a/indra/test_apps/llplugintest/CMakeLists.txt
+++ b/indra/test_apps/llplugintest/CMakeLists.txt
@@ -442,6 +442,7 @@ if(WINDOWS)
     qtnetwork4.dll
     qtopengl4.dll
     qtwebkit4.dll
+    qtxmlpatterns4.dll
     ssleay32.dll
     )
   copy_if_different(
diff --git a/install.xml b/install.xml
index 8f56811634eb6ad1cf2495deec339264f5a80d33..2e317755da68c6f98d666f0a12683891b94c88fc 100644
--- a/install.xml
+++ b/install.xml
@@ -948,9 +948,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>darwin</key>
           <map>
             <key>md5sum</key>
-            <string>e854fd009feeeb617ecfa68f7614ec17</string>
+            <string>44fe5bca65db2951ce91b5b6c8596ee0</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6+flash-darwin-20091215.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-4.6-darwin-20091215.tar.bz2</uri>
           </map>
           <key>linux</key>
           <map>
@@ -962,9 +962,9 @@ anguage Infrstructure (CLI) international standard</string>
           <key>windows</key>
           <map>
             <key>md5sum</key>
-            <string>92cff05661b5547caae7cc6c66d09870</string>
+            <string>3846354e2e20a98c0401317eb114ff5e</string>
             <key>url</key>
-            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-20091123.tar.bz2</uri>
+            <uri>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/llqtwebkit-windows-qt4.6-20091215.tar.bz2</uri>
           </map>
         </map>
       </map>