From ef3238f590c69e658f1c75cc68a524f8c3c07004 Mon Sep 17 00:00:00 2001 From: Alexey Orlenko Date: Tue, 7 Feb 2017 15:39:32 +0200 Subject: [PATCH] server: clean internal structures on close PR-URL: https://github.com/metarhia/JSTP/pull/59 --- lib/server.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/server.js b/lib/server.js index 5493a9ea..28779f68 100644 --- a/lib/server.js +++ b/lib/server.js @@ -72,6 +72,9 @@ Server.prototype.close = function() { const connection = this.clients[cid]; connection.close(); }); + + this.clients = {}; + this._cachedClientsArray = []; }; // Get all clients as an array of JSTP connection instances