Skip to content

Commit

Permalink
fix(connection): remove listeners on close
Browse files Browse the repository at this point in the history
  • Loading branch information
trs committed Feb 10, 2018
1 parent 0c7cc4f commit 8a2454c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}

Expand Down

0 comments on commit 8a2454c

Please sign in to comment.