-
Notifications
You must be signed in to change notification settings - Fork 2k
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
PJAX memory Leak issue #709
Comments
$(document).on('pjax:beforeReplace', function (contents, options) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$(document).on('pjax:beforeReplace', function (contents, options) {
//might prevent memory leak
$(contents.target).empty();
}
This should be added to the memory to prevent memory leak and keep adding old nodes to new nodes if you use PJAX. This unloads all Events from former PJAX pages and should only be used when you have it set on 1 page.
I put this here to see if this is the right approach, and or to fire some ideas upon it.
Before making a pull request for it.
PuiMan Cheui also made an similar issue for it.
https://medium.com/front-end-hacking/pjax-react-2ee247af0fb5
The text was updated successfully, but these errors were encountered: