Skip to content

Commit

Permalink
Fix AVE disposing cloned SKPaint (#2904)
Browse files Browse the repository at this point in the history
Clone should operate on SkCompatPaint
  • Loading branch information
jeremy-visionaid authored Jul 8, 2024
1 parent fe42add commit 58b618c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion binding/SkiaSharp/SKPaint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ public float GetFontMetrics (out SKFontMetrics metrics) =>
// Clone

public SKPaint Clone () =>
GetObject (SkiaApi.sk_paint_clone (Handle))!;
GetObject (SkiaApi.sk_compatpaint_clone (Handle))!;

// MeasureText

Expand Down
8 changes: 8 additions & 0 deletions tests/Tests/SkiaSharp/SKPaintTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -720,5 +720,13 @@ public void CanSetTypefacesWithoutCrashing(string fontfile)

Assert.Same(typeface, paint.Typeface);
}

[SkippableFact]
public void Clone()
{
using var paint = new SKPaint();
using var clonedPaint = paint.Clone();
using var clonedPaint2 = paint.Clone();
}
}
}

0 comments on commit 58b618c

Please sign in to comment.