Skip to content

Commit

Permalink
Safe to call cleanup multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpenev-s committed Feb 6, 2018
1 parent bc6ebff commit 72527a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/protocol/Connection.js
Expand Up @@ -256,8 +256,10 @@ Connection.prototype._addListeners = function _addListeners(socket) {
Connection.prototype._cleanup = function _cleanup() {
this._socket = undefined;
this._state = undefined;
this._queue.abort();
this._queue = undefined;
if (this._queue) {
this._queue.abort();
this._queue = undefined;
}
};

Connection.prototype.send = function send(message, receive) {
Expand Down

0 comments on commit 72527a0

Please sign in to comment.