From 26928c716d2b5e53b1486531fab210ef1c6ef616 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Wed, 28 Jan 2015 06:59:41 -0800 Subject: [PATCH] fix($parse): remove references to last arguments to a fn call This can be an issue if running (and killing) multiple apps/injectors on the same page. The `args` array holds references to all previous arguments to a function call and thus they cannot be garbage-collected. In a regular (one app/injector on a page) app, this is not an issue. --- src/ng/parse.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ng/parse.js b/src/ng/parse.js index 09b751d3bb6d..a4dcac8c2e3b 100644 --- a/src/ng/parse.js +++ b/src/ng/parse.js @@ -728,6 +728,11 @@ Parser.prototype = { ? fn.apply(context, args) : fn(args[0], args[1], args[2], args[3], args[4]); + if (args) { + // Free-up the memory (arguments of the last function call). + args.length = 0; + } + return ensureSafeObject(v, expressionText); }; },