Skip to content

Fix crash disposing GRContext for Metal backend #3258

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jeremy-visionaid
Copy link
Contributor

Description of Change

Use NSObject.DangerousRetain to prevent a double free of the command buffer

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

@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 3 times, most recently from 843e1c5 to a53ebbd Compare April 30, 2025 04:43
AbandonContext appears to destroy the command buffer, causing the
finalizer to crash from a double free.

Fixes: mono#3178
@jeremy-visionaid jeremy-visionaid force-pushed the grcontext-metal-finalizer branch from a53ebbd to 8a1443c Compare April 30, 2025 22:05
@jeremy-visionaid
Copy link
Contributor Author

@mattleibow Perhaps this should be handled in gr_direct_context_make_metal instead?

@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

[BUG] iOS: Crash when GC collects SKMetalView resources
1 participant