From a47e2fc010e588318d11d3fd6592bbb74eb79706 Mon Sep 17 00:00:00 2001 From: Abdulaziz Albahar <67667005+azooz2003-bit@users.noreply.github.com> Date: Fri, 24 Jul 2026 19:09:37 -0700 Subject: [PATCH] Fix iOS build: form the owned-userdata release callback from a closure literal Commit f41507ece2 passed the static method GhosttySurfaceBridge.releaseRetainedOpaque directly to ghostty_surface_new_with_owned_userdata, but Swift forms C function pointers only from global funcs or capture-free closure literals, so every iOS build of CmuxMobileTerminal fails, including the internal TestFlight lane. Wrap the call in a capture-free literal that forwards to the same method; behavior is unchanged. Co-Authored-By: Claude Fable 5 --- .../Sources/CmuxMobileTerminal/GhosttySurfaceView.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift b/Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift index 1de2f599ed4b..31f1af83e0be 100644 --- a/Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift +++ b/Packages/iOS/CmuxMobileTerminal/Sources/CmuxMobileTerminal/GhosttySurfaceView.swift @@ -3481,8 +3481,12 @@ public final class GhosttySurfaceView: UIView, TerminalSurfaceHosting { } } surfaceConfig.io_write_userdata = bridgePointer + // A C function pointer can only be formed from a global func or a + // capture-free closure literal, not a static method reference. guard let createdSurface = ghostty_surface_new_with_owned_userdata( - app, &surfaceConfig, GhosttySurfaceBridge.releaseRetainedOpaque + app, &surfaceConfig, { userdata in + GhosttySurfaceBridge.releaseRetainedOpaque(userdata) + } ) else { retainedBridge.release() return nil