Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

fix($parse): remove references to last arguments to a fn call #10894

Closed
wants to merge 1 commit into from

Conversation

vojtajina
Copy link
Contributor

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.

cc @aaronfrost

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.
@petebacondarwin
Copy link
Contributor

If the $parse service was destroyed and rebuilt would that not free up these objects?

vojtajina added a commit that referenced this pull request Jan 29, 2015
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.

Closes #10894
@vojtajina vojtajina closed this in e61eae1 Jan 29, 2015
@jbedard
Copy link
Contributor

jbedard commented Jan 29, 2015

Is there any point keeping the array around if it gets set to a length of 0 each time? Does that still avoid reallocating each time?

@ghost
Copy link

ghost commented Jun 13, 2015

Just a note: this issue could have still created memory leaks in a single-injector app when using ng-view.

Passing a function argument refering to the DOM (such as $event) would have caused the DOM reference to be indirectly cached. After switching the view away, its entire DOM would have been leaked, including directives, scopes, etc.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants