Bug 1001134 - Gamepad service leaks windows if a page goes into bfcache. r=ted, r=continuation, a=lsblakk
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Thu, 24 Apr 2014 14:51:00 +0200
changeset 193178 92eb6a82595cb1c3cdf7270fab341e1b36cf9933
parent 193177 041d2a2ee631fb6d830c47a372c4a066731ca111
child 193179 3debec91f196b886d5a94cdce858d63ef5349181
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, continuation, lsblakk
bugs1001134
milestone30.0a2
Bug 1001134 - Gamepad service leaks windows if a page goes into bfcache. r=ted, r=continuation, a=lsblakk
dom/base/nsGlobalWindow.cpp
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -1597,16 +1597,18 @@ nsGlobalWindow::FreeInnerObjects()
   CleanupCachedXBLHandlers(this);
 
   for (uint32_t i = 0; i < mAudioContexts.Length(); ++i) {
     mAudioContexts[i]->Shutdown();
   }
   mAudioContexts.Clear();
 
 #ifdef MOZ_GAMEPAD
+  DisableGamepadUpdates();
+  mHasGamepad = false;
   mGamepads.Clear();
 #endif
 }
 
 //*****************************************************************************
 // nsGlobalWindow::nsISupports
 //*****************************************************************************