Skip to content

fix: resolve CF/CG memory leaks and ARC ownership issues - #1278

Merged
Kyle-Ye merged 1 commit into
mainfrom
bugfix/arc
Nov 28, 2026
Merged

Kyle-Ye merged 1 commit into
mainfrom
bugfix/arc

Conversation

@Kyle-Ye

@Kyle-Ye Kyle-Ye commented Nov 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Release the CGColorSpaceRef created via CGColorSpaceCreateWithName(kCGColorSpaceExtendedSRGB) after passing it to NSColorSpaceForCGColorSpace in OpenSwiftUICoreColor.m.
  • Transfer ownership of the CFArrayCreateMutable result to ARC via CFBridgingRelease in _CAFilterArrayCreate.
  • Transfer ownership of the MGCopyAnswer result to ARC via CFBridgingRelease in _CUIDefaultDisplayGamut and annotate MGCopyAnswer, MGCopyAnswerWithError, and MGCopyMultipleAnswers with CF_RETURNS_RETAINED in MobileGestalt.h.
  • Use .takeUnretainedValue() for UIColor.perform(_:) and NSColor.perform(_:) in KitCoreUINamedColorProvider.effectiveCGColor(cuiColor:in:).
  • Return self from -[UIColor(OpenSwiftUI) initWithColor__openSwiftUI__:].

Fixes #1276

@Kyle-Ye Kyle-Ye added this to the 0.26.0 milestone Nov 28, 2026
@Kyle-Ye Kyle-Ye added type: bug Something is not working correctly. area: graphics Color, shape, gradient, image, symbols, and graphics primitives. impact: memory-leak Leak or memory lifecycle issue. labels Nov 28, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T16:41:56.432228Z 8caea82 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@tuist

tuist Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

🛠️ Tuist Run Report 🛠️

Tests 🧪

Scheme Status Ran test modules Commit
OpenSwiftUI ✅ 7 8003cd2f3

Builds 🔨

Scheme Status Duration Commit
OpenSwiftUI ✅ 1m 1s 8003cd2f3

Reported by Tuist, faster builds and reliable tests for Xcode, Gradle, Bazel, and more.

@codecov

codecov Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 35.08%. Comparing base (8751bee) to head (8caea82).

Files with missing lines Patch % Lines
...UI/Graphic/Color/KitCoreUINamedColorProvider.swift 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1278   +/-   ##
=======================================
  Coverage   35.08%   35.08%           
=======================================
  Files        1046     1046           
  Lines       85554    85554           
=======================================
+ Hits        30014    30015    +1     
+ Misses      55540    55539    -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Kyle-Ye
Kyle-Ye merged commit 95ee561 into main Nov 28, 2026
7 checks passed
@Kyle-Ye
Kyle-Ye deleted the bugfix/arc branch November 28, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: graphics Color, shape, gradient, image, symbols, and graphics primitives. impact: memory-leak Leak or memory lifecycle issue. type: bug Something is not working correctly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix CF/CG memory leaks and ARC ownership issues

1 participant