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

src: refactor and apply fixes #2229

Merged
merged 1 commit into from
Apr 17, 2023
Merged

Conversation

VoltrexKeyva
Copy link
Contributor

Thanks for contributing!

  • Have you updated CHANGELOG.md?

- 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.
Copy link
Collaborator

@zbjornson zbjornson left a comment

Choose a reason for hiding this comment

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

Great fixes, thank you.

@zbjornson zbjornson merged commit f3184ba into Automattic:master Apr 17, 2023
@VoltrexKeyva VoltrexKeyva deleted the refactor-src branch April 17, 2023 16:39
Copy link
Collaborator

@LinusU LinusU left a comment

Choose a reason for hiding this comment

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

Amazing work 😍

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.
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

3 participants