Skip to content

Commit

Permalink
Merge pull request jashkenas#1895 from zertosh/fix-once-before-leak
Browse files Browse the repository at this point in the history
Release func in _.before and _.once
  • Loading branch information
michaelficarra committed Oct 19, 2014
2 parents 37a0079 + 631d076 commit e83655e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion underscore.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,8 @@
return function() {
if (--times > 0) {
memo = func.apply(this, arguments);
} else {
}
if (times <= 1) {
func = null;
}
return memo;
Expand Down

0 comments on commit e83655e

Please sign in to comment.