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(memory_leaks): Ensuring events get unbound when grid is destroyed. #5913

Merged
merged 1 commit into from
Dec 28, 2016
Merged

fix(memory_leaks): Ensuring events get unbound when grid is destroyed. #5913

merged 1 commit into from
Dec 28, 2016

Conversation

mportuga
Copy link
Member

Adding a set of destroy listeners that unbinds jquery events when the grid is destroyed.

#4203

Adding a set of destroy listeners that unbinds jquery events when the grid is destroyed.

#4203
@mportuga mportuga requested a review from dlgski December 23, 2016 18:28
@@ -1278,6 +1278,11 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
for ( var i = mouseWheeltoBind.length; i; ) {
$elm.on(mouseWheeltoBind[--i], cbs[fn]);
}
$elm.on('$destroy', function unbindEvents() {
for ( var i = mouseWheeltoBind.length; i; ) {
$elm.off(mouseWheeltoBind[--i], cbs[fn]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like it may be something that needs additional refactoring

@dlgski dlgski merged commit da942e9 into angular-ui:master Dec 28, 2016
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.

2 participants