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

Plug memory leak #20

Merged
merged 2 commits into from Feb 13, 2020
Merged

Plug memory leak #20

merged 2 commits into from Feb 13, 2020

Conversation

JKingweb
Copy link
Contributor

This bug existed in Picofeed originally and had been reported by me, but had not been acted upon before the repository was archived and, ultimately, deleted.

When fetching HTML documents Picofeed would buffer libxml's error reports, but then would never clear the buffer. Any subsequent use of document loading with the DOM class would thereafter also buffer errors, needlessly consuming memory.

Copy link
Contributor

@aaronpk aaronpk left a comment

Choose a reason for hiding this comment

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

The function that stores the errors is static, so $errors needs to be defined static and written with self::$errors[] instead of $this->errors[]. Here is a diff for what needs to change in this PR: aaronpk/picofeed@b1f4448

@JKingweb
Copy link
Contributor Author

I'm embarrassed I missed that. Thanks.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 69

  • 9 of 9 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 95.474%

Totals Coverage Status
Change from base Build 63: 0.002%
Covered Lines: 1772
Relevant Lines: 1856

💛 - Coveralls

@nicolus
Copy link
Owner

nicolus commented Feb 11, 2020

Hi there ! Thanks for the PR.
Sorry I'm a bit behind, I'll take some time to merge everything this week.

@nicolus nicolus merged commit 0ebdf92 into nicolus:master Feb 13, 2020
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.

None yet

4 participants