From 8a2454ceea738bb180fd8c7439884a7b0ab18b3d Mon Sep 17 00:00:00 2001 From: Tyler Stewart Date: Sun, 21 Jan 2018 13:28:20 -0700 Subject: [PATCH] fix(connection): remove listeners on close --- src/connection.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/connection.js b/src/connection.js index 040796d4..7087763a 100644 --- a/src/connection.js +++ b/src/connection.js @@ -34,6 +34,7 @@ class FtpConnection extends EventEmitter { this.commandSocket.on('close', () => { if (this.connector) this.connector.end(); if (this.commandSocket && !this.commandSocket.destroyed) this.commandSocket.destroy(); + this.removeAllListeners(); }); }