Remove self-reference in PelIfd::$maker_notes#7
Open
saemy wants to merge 1 commit intoFileEye:masterfrom
Open
Conversation
`PelIfd::$maker_notes["parent"]` is always `$this` (there is only one caller of `PelIfd::setMakerNotes()`). However, adding `$this` to the array leads to a reference of a `PelIfd` instance to itself. As a result that `PelIfd` instance can not be cleaned up right away after all references to it go away (as the ref_count remains at 1 - the one to itself). Only at garbage collection time the garbage cycle is detected and that instance is cleaned up. This is an issue in case big images are processed one after another. In that scenario `PelIfd::$maker_notes['data']` contains the full image data (i.e. multiple MB) and is only released upon garbage collection time - which is not right away. Garbage memory is piling up and running out of memory is easily possible and the program might crash with `"Fatal error: Allowed memory size of xxx bytes exhausted"`. Removes the self-reference in the `PelIfd::$maker_notes` array. fixes: FileEye#6
|
Thank you, the changes are sensible, however I am not keen to touch maker note related code for the moment. Test coverage is very fragile for this part. We need first to address #8 . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes the self-reference in the
PelIfd::$maker_notesarray as described in issue #6.Fixes: #6