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

fix(ncyBreadcrumb): Prevent memory leak when label is a binding #88

Merged
merged 1 commit into from
May 14, 2015

Conversation

tghamm
Copy link
Contributor

@tghamm tghamm commented May 2, 2015

Releases collection of watchers, preventing a leak when the label is a binding and not a string.

We found that when using ui-router state definitions, if we used a binding (pictured below) and not a string constant, the related scope is leaked and held onto. The deregisterWatchers() function does not actually clear out the collection passed in. This causes the functions in the collections to accumulate, and in this scenario they hold references to scopes.

Clearing out the collections in the calling functions releases the references as expected.

image

Releases collection of watchers, preventing a leak when the label is a binding and not a string
@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 96.71% when pulling 264e10f on castle-it:fix-memoryLeak into ef73525 on ncuillery:master.

@ncuillery
Copy link
Owner

Hi, thank you for your PR.

Shame of me, arrays are passed by value of course 😅

ncuillery added a commit that referenced this pull request May 14, 2015
fix(ncyBreadcrumb): Prevent memory leak when label is a binding
@ncuillery ncuillery merged commit 3f3dbce into ncuillery:master May 14, 2015
@tghamm
Copy link
Contributor Author

tghamm commented May 14, 2015

You've built an excellent tool, we're happy to contribute where we can :)

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

Successfully merging this pull request may close these issues.

3 participants