Skip to content

Commit

Permalink
fix(Link): properly call _detached on force detach to cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Nov 5, 2015
1 parent f9df0e8 commit 79544c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ Link.prototype.detach = function() {
Link.prototype.forceDetach = function() {
debug('Force-detach for ' + this.name + '. Current state: ' + this.state());
this.linkSM.forceDetach();
this._detached();
};

// private api
Expand Down Expand Up @@ -171,6 +172,7 @@ Link.prototype._sendDetach = function() {
};

Link.prototype._detached = function(frame) {
frame = frame || {};
if (frame && frame.error) {
this.emit(Link.ErrorReceived, frame.error);
}
Expand Down
2 changes: 1 addition & 1 deletion test/benchmarks/simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ client.connect('amqp://' + server)
if (receivedCount === messageCount) {
finish = new Date();
console.log('=> sent ' + messageCount + ' messages in ' + (finish.getTime() - start.getTime()) + 'ms');
process.exit(0);
client.disconnect().then(function() { process.exit(0); });
}
});

Expand Down

0 comments on commit 79544c4

Please sign in to comment.