Fix reconnect abort logic on client.destroy()

This commit is contained in:
Patrick Mooney 2014-06-24 13:25:21 -05:00
parent 41f99c5b1a
commit a0fd56d7b3
1 changed files with 4 additions and 2 deletions

View File

@ -940,9 +940,11 @@ Client.prototype._connect = function _connect() {
}
this.connecting = true;
retry.start();
// Abbord reconnection attemps if client is destroyed
// Abort reconnection attempts if client is destroyed
this.on('destroy', function () {
retry.abort();
if (retry.isRunning()) {
retry.abort();
}
});
};