src: refactor and apply fixes#2229
Merged
zbjornson merged 1 commit intoAutomattic:masterfrom Apr 17, 2023
Merged
Conversation
- Defer the initialization of the `op` variable to the `default` switch case to avoid a compiler warning. - Use a `default` switch case with a null statement if some enum values aren't suppsed to be handled, this avoids a compiler warning. - Migrate from librsvg's deprecated `rsvg_handle_get_dimensions()` and `rsvg_handle_render_cairo()` functions to the new `rsvg_handle_get_intrinsic_size_in_pixels()` and `rsvg_handle_render_document()` respectively. - Avoid calling virtual methods in constructors/destructors to avoid bypassing virtual dispatch. - Remove unused private field `backend` in the `Backend` class. - Fix a case of use-after-free. - Fix usage of garbage value by filling the allocated memory entirely with zeros if it's not modified. - Fix a potential memory leak.
70591bd to
88cb853
Compare
zbjornson
approved these changes
Apr 17, 2023
Collaborator
zbjornson
left a comment
There was a problem hiding this comment.
Great fixes, thank you.
zbjornson
added a commit
that referenced
this pull request
Apr 14, 2024
Added in #2229, this is a C++20 feature. For now we're on C++17 (by way of Node.js v18).
zbjornson
added a commit
that referenced
this pull request
Jun 19, 2024
#2229 switched to new librsvg APIs only available in 2.52.0.
zbjornson
added a commit
that referenced
this pull request
Jun 19, 2024
#2229 switched to new librsvg APIs only available in 2.52.0.
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.
Thanks for contributing!