Bug 649564 - Try to ensure that the socks client subprocess is never killed after the process completes. r=ted-irc
authorJosh Matthews <josh@joshmatthews.net>
Wed, 18 Jan 2012 14:13:33 -0500
changeset 86030 5a8bf51c8ede454e676b6f9a10219658e9672588
parent 86029 7736d47f8fab770803b227527364363a59ab2135
child 86031 1b9c27fad1b935b7a280c78f0182717567fa3caa
push id805
push userakeybl@mozilla.com
push dateWed, 01 Feb 2012 18:17:35 +0000
treeherdermozilla-aurora@6fb3bf232436 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted-irc
bugs649564
milestone12.0a1
Bug 649564 - Try to ensure that the socks client subprocess is never killed after the process completes. r=ted-irc
netwerk/test/unit/test_socks.js
--- a/netwerk/test/unit/test_socks.js
+++ b/netwerk/test/unit/test_socks.js
@@ -437,21 +437,27 @@ SocksTestServer.prototype = {
     var input = trans.openInputStream(0, 0, 0);
     var output = trans.openOutputStream(0, 0, 0);
     var client = new SocksClient(this, input, output);
     this.client_connections.push(client);
   },
 
   close: function()
   {
-    if (this.client_subprocess)
+    if (this.client_subprocess) {
       this.client_subprocess.kill();
+      this.client_subprocess = null;
+    }
     for each (var client in this.client_connections)
       client.close();
-    this.listener.close();
+    this.client_connections = [];
+    if (this.listener) {
+      this.listener.close();
+      this.listener = null;
+    }
   }
 };
 
 function test_timeout()
 {
   socks_test_server.close();
   do_throw("SOCKS test took too long!");
 }