Skip to content

Commit

Permalink
Merge pull request #351 from fluture-js/avaq/hook-bug
Browse files Browse the repository at this point in the history
Fix hook disposing twice when cancelled during disposal
  • Loading branch information
Avaq committed Jun 20, 2019
2 parents 8284c87 + 933630a commit 21f6181
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hook.mjs
Expand Up @@ -53,8 +53,8 @@ Hook.prototype._interpret = function Hook$interpret(rec, rej, res){
if(!isFuture(disposal)){
return rec(makeError(invalidDisposal(disposal, _dispose, resource), _this, context));
}
disposal._interpret(Hook$disposalCrashed, Hook$disposalRejected, Hook$done);
cancel = Hook$cancelDisposal;
disposal._interpret(Hook$disposalCrashed, Hook$disposalRejected, Hook$done);
}

function Hook$cancelConsumption(){
Expand Down

0 comments on commit 21f6181

Please sign in to comment.