Skip to content

Fix Skia path bounds races and disposed stroke cache reuse - #22504

Merged
kekekeks merged 2 commits into
AvaloniaUI:mainfrom
hez2010:fix/geometry-av
Oct 19, 2026
Merged

kekekeks merged 2 commits into
AvaloniaUI:mainfrom
hez2010:fix/geometry-av

Conversation

@hez2010

@hez2010 hez2010 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What does the pull request do?

Fixes two Skia geometry cache defects affecting rendering and hit testing.

What is the current behavior?

  • Some geometry constructors publish paths before their native bounds caches are initialized. Skia computes these bounds lazily, allowing rendering and hit testing to write the same cache concurrently.
  • Stroke-cache replacement updates the cache key and disposes the previous path before creating its replacement. If creation throws, subsequent calls can reuse the disposed path.

What is the updated/expected behavior with this PR?

Initialize the missing native bounds caches during geometry construction. Create replacement strokes before changing the existing cache.

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

This is related to #22391, #21964 and might fix them. Since they didn't provide the repro, I cannot say this must fix the problems for them.

@github-actions

Copy link
Copy Markdown

NuGet packages

The packages for this pull request have been published (workflow run):

@MrJul MrJul added bug backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch area-rendering labels Oct 19, 2026
@kekekeks
kekekeks added this pull request to the merge queue Oct 19, 2026
Merged via the queue into AvaloniaUI:main with commit ee85f06 Oct 19, 2026
12 checks passed
MrJul pushed a commit that referenced this pull request Nov 2, 2026
* Prevent bounds races and disposed stroke cache reuse

* Adding tests
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Nov 2, 2026
@LaurentInSeattle

Copy link
Copy Markdown

Using 12.1.5, this does NOT fix this issue: #22391

@hez2010 : Repro was provided. Grid, two images, splitter in the middle, move it, again, about 20 times or more => Crash

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.

4 participants