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

Fix SKPaint.Clone #2904

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Fix SKPaint.Clone #2904

merged 1 commit into from
Jul 8, 2024

Conversation

jeremy-visionaid
Copy link
Contributor

Clone should operate on SkCompatPaint

Description of Change

Fix crash on dispose of a cloned SKPaint

Bugs Fixed

API Changes

None.

Behavioral Changes

None.

Required skia PR

None.

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of main at time of PR
  • Merged related skia PRs
  • Changes adhere to coding standard
  • Updated documentation

Clone should operate on SkCompatPaint
@chersoft-oliverb
Copy link

chersoft-oliverb commented Jul 8, 2024

Hi @mattleibow could you cast an 👀 over this please?

We'd like to prep our codebase for 3.0 but this issue is a blocker at the moment.

Thanks!

Copy link
Contributor

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

This is exactly what should have been done.

The clone is not a normal function like the rest, it just instantiates a copy:

sk_paint_t* sk_paint_clone(sk_paint_t* paint) {
    return ToPaint(new SkPaint(*AsPaint(paint)));
}

Thanks!

@mattleibow mattleibow merged commit 58b618c into mono:main Jul 8, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] (preview3.1) Access violation when a Cloned SKPaint is disposed/finalized
3 participants