Skip to content

Conversation

jeremy-visionaid
Copy link
Contributor

@jeremy-visionaid jeremy-visionaid commented Apr 30, 2025

Description of Change

Unit test for double free fixed in

Bugs Fixed

Fixes: #3178

API Changes

None.

Behavioral Changes

None.

Required skia PR

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

@jeremy-visionaid jeremy-visionaid changed the title Fix crash in GRContext metal finalizer Fix crash in GRContext Metal backend finalizer Apr 30, 2025
@jeremy-visionaid jeremy-visionaid force-pushed the grcontext-metal-finalizer branch 4 times, most recently from a53ebbd to 8a1443c Compare April 30, 2025 22:05
@jeremy-visionaid jeremy-visionaid marked this pull request as ready for review May 23, 2025 02:58
@jeremy-visionaid jeremy-visionaid changed the title Fix crash in GRContext Metal backend finalizer Fix crash disposing GRContext for Metal backend May 23, 2025
@jeremy-visionaid jeremy-visionaid force-pushed the grcontext-metal-finalizer branch from 8a1443c to 0fb74fb Compare June 3, 2025 21:10
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.

I am not 100% sure if we are supposed to retain, but according to instruments this does not leak. So I guess we are supposed to?

I see various places that have retain on there, so this is looking safe for now.

@jeremy-visionaid
Copy link
Contributor Author

I've moved the corresponding fix for the double free to mono/skia#159

@jeremy-visionaid jeremy-visionaid changed the title Fix crash disposing GRContext for Metal backend Test disposing GRContext does not crash for Metal backend Aug 21, 2025
@mattleibow mattleibow force-pushed the grcontext-metal-finalizer branch from 50cefd3 to cc80eb4 Compare August 22, 2025 17:51
@mattleibow
Copy link
Contributor

Thanks for all this investigation!

@mattleibow mattleibow merged commit c1cd0ce into mono:main Aug 22, 2025
1 check passed
@github-project-automation github-project-automation bot moved this from Changes Requested to Done in SkiaSharp Backlog Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[BUG] iOS: Crash when GC collects SKMetalView resources
2 participants