From 1ea19daad92f4de90447a10ed2ef0e205c1b94c1 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 9 Aug 2012 00:16:35 -0700 Subject: [PATCH] Clear the `func` variable in `_.once` so the function may be garbage collected. Former-commit-id: 521a9d997cb206a5c468b30e5dfa8e096e1a13d5 --- lodash.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lodash.js b/lodash.js index 943d44000..b99e317cc 100644 --- a/lodash.js +++ b/lodash.js @@ -3421,6 +3421,9 @@ } ran = true; result = func.apply(this, arguments); + + // clear the `func` variable so the function may be garbage collected + func = null; return result; }; }