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

Transitions between sibling states retain scopes (memory leak) #1766

Closed
smhc opened this issue Feb 20, 2015 · 2 comments
Closed

Transitions between sibling states retain scopes (memory leak) #1766

smhc opened this issue Feb 20, 2015 · 2 comments

Comments

@smhc
Copy link

smhc commented Feb 20, 2015

When transitioning between sibling states when the initial page load is a sibling state, the scopes are not correctly destroyed.

An example:
http://plnkr.co/edit/nPXyZtS883o0Y9eVoksl

When the initial page load is directly to #/home/a then going to #/home/b results in both "SibAObject" and "SibBObject" being on the heap. (perform a heap snapshot after navigation and search for "Sib").

However, when the initial page load is to #/home, navigations between A and B sibling states do clear the scope and the SibAObject and SibBObject only exist on the heap under the correct state.

@smhc
Copy link
Author

smhc commented Feb 20, 2015

The problem also exists when the initial page load is #/home/a and subsequently navigating to #/home. Under this scenario the 'SibAObject' still exists.

It appears whatever the 'landing' state is gets retained for the life of the state hierarchy, even if the landing state is a nested child state that is navigated away from.

@smhc
Copy link
Author

smhc commented May 29, 2015

This appears fixed by angular 1.4.

Edit; To be more exact, it appears fixed in 1.3.15. I assume due to the fix: angular/angular.js#11173

@smhc smhc closed this as completed May 29, 2015
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

1 participant