Bug 716692 - browser.js needs to stop observing browser.tabs.onTop when the browser window is closed. r=gavin
authorDão Gottwald <dao@mozilla.com>
Tue, 10 Jan 2012 10:13:26 +0100
changeset 84093 838aece95748a64bc31c93ba4696e19c77378ab3
parent 84092 d33ae35163056ca8b47e04bae72e75bae973dd07
child 84094 b2447177ec5aaa7ade93fd129c5c723710d9c2e2
push id21823
push userbmo@edmorley.co.uk
push dateTue, 10 Jan 2012 18:04:13 +0000
treeherdermozilla-central@011e3cef6068 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs716692
milestone12.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 716692 - browser.js needs to stop observing browser.tabs.onTop when the browser window is closed. r=gavin
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1781,16 +1781,18 @@ function BrowserShutdown() {
     gBrowser.removeTabsProgressListener(window.TabsProgressListener);
   } catch (ex) {
   }
 
   PlacesStarButton.uninit();
 
   gPrivateBrowsingUI.uninit();
 
+  TabsOnTop.uninit();
+
   TabsInTitlebar.uninit();
 
   var enumerator = Services.wm.getEnumerator(null);
   enumerator.getNext();
   if (!enumerator.hasMoreElements()) {
     document.persist("sidebar-box", "sidebarcommand");
     document.persist("sidebar-box", "width");
     document.persist("sidebar-box", "src");
@@ -5286,16 +5288,20 @@ function setToolbarVisibility(toolbar, i
 }
 
 var TabsOnTop = {
   init: function TabsOnTop_init() {
     this.syncUI();
     Services.prefs.addObserver(this._prefName, this, false);
   },
 
+  uninit: function TabsOnTop_uninit() {
+    Services.prefs.removeObserver(this._prefName, this);
+  },
+
   toggle: function () {
     this.enabled = !Services.prefs.getBoolPref(this._prefName);
   },
 
   syncUI: function () {
     let userEnabled = Services.prefs.getBoolPref(this._prefName);
     let enabled = userEnabled && gBrowser.tabContainer.visible;