Bug 1302702 - Check if the threadActor is attached before using it in tab actor's _windowReady. r=ochameau
authorLuca Greco <lgreco@mozilla.com>
Thu, 11 May 2017 18:54:26 +0200
changeset 358816 f0df4a7f6551e886388c876f0da8b2c1de86f64f
parent 358815 52b1e896a2740ef0c307c849b1e4562f2c32c45f
child 358817 464d9f5c2c3cdee93c469f5c9ff6aad432d54598
push id42859
push userryanvm@gmail.com
push dateWed, 17 May 2017 19:28:47 +0000
treeherderautoland@f0df4a7f6551 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau
bugs1302702
milestone55.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 1302702 - Check if the threadActor is attached before using it in tab actor's _windowReady. r=ochameau MozReview-Commit-ID: IexaXRL27Lu
devtools/server/actors/tab.js
--- a/devtools/server/actors/tab.js
+++ b/devtools/server/actors/tab.js
@@ -1163,16 +1163,22 @@ TabActor.prototype = {
 
     this._windowDestroyed(this.window, null, true);
 
     // Immediately change the window as this window, if in process of unload
     // may already be non working on the next cycle and start throwing
     this._setWindow(window);
 
     DevToolsUtils.executeSoon(() => {
+      // No need to do anything more if the actor is not attached anymore
+      // e.g. the client has been closed and the actors destroyed in the meantime.
+      if (!this.attached) {
+        return;
+      }
+
       // Then fake window-ready and navigate on the given document
       this._windowReady(window, true);
       DevToolsUtils.executeSoon(() => {
         this._navigate(window, true);
       });
     });
   },