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 - Forgot to remove the modal attached to scope from ionicModal.fromTemplateUrl #129

Closed
concertcoder opened this issue Dec 14, 2015 · 3 comments

Comments

@concertcoder
Copy link

Hey,

I was going through my project fixing up any memory leaks and I found one in your project.

$ionicModal.fromTemplateUrl('ionic-datepicker-modal.html', {
scope: scope,
animation: 'slide-in-up'
}).then(function (modal) {
scope.modal = modal;
});

The modal attached to scope needs to be cleaned up when the scope is destroyed.

scope.$on('$destroy', function() {
scope.modal.remove();
});

Just put this below that piece of code and it'll fix the memory leak.

@rajeshwarpatlolla
Copy link
Owner

Thanks for pointing it out @concertcoder

@concertcoder
Copy link
Author

@rajeshwarpatlolla No problem, thanks for the code ;)

@rajeshwarpatlolla
Copy link
Owner

Please check the new release v1.0.0. This issue has been addressed.

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

2 participants