Bug 927398 - Missing call to .uninit() in DOMRequestHelper. r=fabrice
☠☠ backed out by 2f4f9208018a ☠ ☠
authorFernando Jiménez <ferjmoreno@gmail.com>
Thu, 17 Oct 2013 22:29:59 +0200
changeset 164981 03b50ae14f9bd4dc764d6ef2ddbf260ca613406e
parent 164980 5349c5c0d9f86856d847e1d6a8f8e6d5f68a9114
child 164982 dbc405bc63b53deff08bfa1b632491ebe517d210
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfabrice
bugs927398
milestone27.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 927398 - Missing call to .uninit() in DOMRequestHelper. r=fabrice
dom/base/DOMRequestHelper.jsm
--- a/dom/base/DOMRequestHelper.jsm
+++ b/dom/base/DOMRequestHelper.jsm
@@ -154,29 +154,40 @@ DOMRequestIpcHelper.prototype = {
                              .getInterface(Ci.nsIDOMWindowUtils);
       this.innerWindowID = util.currentInnerWindowID;
     }
 
     Services.obs.addObserver(this, "inner-window-destroyed", false);
   },
 
   destroyDOMRequestHelper: function() {
+    if (this._destroyed) {
+      return;
+    }
+
+    this._destroyed = true;
+
     Services.obs.removeObserver(this, "inner-window-destroyed");
 
     if (this._listeners) {
       Object.keys(this._listeners).forEach((aName) => {
         this._listeners[aName] ? cpmm.removeMessageListener(aName, this)
                                : cpmm.removeWeakMessageListener(aName, this);
         delete this._listeners[aName];
       });
     }
 
     this._listeners = null;
     this._requests = null;
     this._window = null;
+
+    // Objects inheriting from DOMRequestIPCHelper may have an uninit function.
+    if (this.uninit) {
+      this.uninit();
+    }
   },
 
   observe: function(aSubject, aTopic, aData) {
     if (aTopic !== "inner-window-destroyed") {
       return;
     }
 
     let wId = aSubject.QueryInterface(Ci.nsISupportsPRUint64).data;