Bug 1117067 - Don't wait for tab.detach to complete. r=ochameau a=lmandel
authorJ. Ryan Stinnett <jryans@gmail.com>
Wed, 11 Feb 2015 22:14:13 -0600
changeset 249712 8a7929c589d1ff42bdbbebf834aa9f08f58d99c4
parent 249711 0b12195e1e05b412b26a15b4e4b5d4b4ae04550d
child 249713 c5e12814f601f4cf009f7c1465039a708960c30c
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersochameau, lmandel
bugs1117067
milestone37.0a2
Bug 1117067 - Don't wait for tab.detach to complete. r=ochameau a=lmandel
browser/devtools/framework/target.js
--- a/browser/devtools/framework/target.js
+++ b/browser/devtools/framework/target.js
@@ -588,17 +588,20 @@ TabTarget.prototype = {
       if (this.isLocalTab) {
         // We started with a local tab and created the client ourselves, so we
         // should close it.
         this._client.close(cleanupAndResolve);
       } else {
         // The client was handed to us, so we are not responsible for closing
         // it. We just need to detach from the tab, if already attached.
         if (this.activeTab) {
-          this.activeTab.detach(cleanupAndResolve);
+          // |detach| may fail if the connection is already dead, so proceed
+          // cleanup directly after this.
+          this.activeTab.detach();
+          cleanupAndResolve();
         } else {
           cleanupAndResolve();
         }
       }
     }
 
     return this._destroyer.promise;
   },