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

PJAX memory Leak issue #709

Open
cablegunmaster opened this issue Oct 3, 2018 · 1 comment
Open

PJAX memory Leak issue #709

cablegunmaster opened this issue Oct 3, 2018 · 1 comment

Comments

@cablegunmaster
Copy link

cablegunmaster commented Oct 3, 2018

$(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

@BlackSwan22
Copy link

$(document).on('pjax:beforeReplace', function (contents, options) {
//might prevent memory leak
$(contents.target).empty();
}

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