Bug 1169808 - Clean up log path on simulator exit. r=janx
authorJ. Ryan Stinnett <jryans@gmail.com>
Fri, 29 May 2015 00:14:34 -0500
changeset 248059 7deb2a4309b9b3170a3e075c14f1cb9ae1240898
parent 248058 e7875576b0427c666f350ef6d9449dd97b031d36
child 248060 d251ac45a5e25f01583fe8fc6dd51d486e1e75db
push id60888
push userkwierso@gmail.com
push dateThu, 11 Jun 2015 01:38:38 +0000
treeherdermozilla-inbound@39e638ed06bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanx
bugs1169808
milestone41.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 1169808 - Clean up log path on simulator exit. r=janx
browser/devtools/webide/modules/simulator-process.js
--- a/browser/devtools/webide/modules/simulator-process.js
+++ b/browser/devtools/webide/modules/simulator-process.js
@@ -62,18 +62,23 @@ SimulatorProcess.prototype = {
 
         Subprocess.call({
           command: "/usr/bin/osascript",
           arguments: ["-e", 'tell application "' + path + '" to activate'],
         });
       }
     });
 
-    this.on("stdout", (e, data) => this.log(e, data.trim()));
-    this.on("stderr", (e, data) => this.log(e, data.trim()));
+    let logHandler = (e, data) => this.log(e, data.trim());
+    this.on("stdout", logHandler);
+    this.on("stderr", logHandler);
+    this.once("exit", () => {
+      this.off("stdout", logHandler);
+      this.off("stderr", logHandler);
+    });
 
     let environment;
     if (OS.indexOf("linux") > -1) {
       environment = ["TMPDIR=" + Services.dirsvc.get("TmpD", Ci.nsIFile).path];
       ["DISPLAY", "XAUTHORITY"].forEach(key => {
         if (key in Environment) {
           environment.push(key + "=" + Environment[key]);
         }