Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak: Watchers are not torn down properly on route change #106

Closed
jgrund opened this issue Oct 5, 2015 · 4 comments
Closed

Memory Leak: Watchers are not torn down properly on route change #106

jgrund opened this issue Oct 5, 2015 · 4 comments

Comments

@jgrund
Copy link
Contributor

jgrund commented Oct 5, 2015

When a route changes, any watcher properties do not seem to be destroyed. Instead they live on in $rootScope leaking memory and making more calls.

Because the reference is lost once we change routes, we can no longer GC and destroy the watcher.
This ends up compounding the issue and can be quite bad.

jgrund pushed a commit to jgrund/angular-route-segment that referenced this issue Oct 5, 2015
  Remove clearWatcher on any segments that get set to null so they don't
  remain in the $rootScope.$$watchers list.
@wayneseymour
Copy link

👍

1 similar comment
@johnsonw
Copy link

johnsonw commented Oct 5, 2015

👍

@johnsonw
Copy link

johnsonw commented Oct 5, 2015

Please expedite this if possible.

@jgrund jgrund mentioned this issue Oct 5, 2015
@jgrund
Copy link
Contributor Author

jgrund commented Oct 5, 2015

@artch Any idea on this test run? doesn't seem relative to my changes:

https://travis-ci.org/artch/angular-route-segment/builds/83714232

jgrund pushed a commit to jgrund/angular-route-segment that referenced this issue Oct 6, 2015
  Remove clearWatcher on any segments that get set to null so they don't
  remain in the $rootScope.$$watchers list.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants