Bug 837208 - Closing a private browsing window yields NS_ERROR_FAILURE in removeObserver() at LightweightThemeConsumer.jsm:64; r=ehsan
authorTim Taubert <ttaubert@mozilla.com>
Fri, 01 Feb 2013 14:31:32 -0500
changeset 130602 4f53e2898a449c214523be43874ad799969350c1
parent 130601 66295fcfee1309d80ed5d30886fe4ec049230060
child 130603 2bff5a9d9783b529c619fad4e7f76fcc302e9240
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs837208
milestone21.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 837208 - Closing a private browsing window yields NS_ERROR_FAILURE in removeObserver() at LightweightThemeConsumer.jsm:64; r=ehsan
toolkit/content/LightweightThemeConsumer.jsm
--- a/toolkit/content/LightweightThemeConsumer.jsm
+++ b/toolkit/content/LightweightThemeConsumer.jsm
@@ -54,21 +54,24 @@ LightweightThemeConsumer.prototype = {
     if (this._lastScreenWidth != width || this._lastScreenHeight != height) {
       this._lastScreenWidth = width;
       this._lastScreenHeight = height;
       this._update(this._lastData);
     }
   },
 
   destroy: function () {
-    Components.classes["@mozilla.org/observer-service;1"]
-              .getService(Components.interfaces.nsIObserverService)
-              .removeObserver(this, "lightweight-theme-styling-update");
+    if (!PrivateBrowsingUtils.isWindowPrivate(this._win)) {
+      Components.classes["@mozilla.org/observer-service;1"]
+                .getService(Components.interfaces.nsIObserverService)
+                .removeObserver(this, "lightweight-theme-styling-update");
 
-    this._win.removeEventListener("resize", this);
+      this._win.removeEventListener("resize", this);
+    }
+
     this._win = this._doc = null;
   },
 
   _update: function (aData) {
     if (!aData)
       aData = { headerURL: "", footerURL: "", textcolor: "", accentcolor: "" };
 
     this._lastData = aData;