From c4386e9db3f37d54faf668ca599e1b2f67767acb Mon Sep 17 00:00:00 2001 From: Saagar Jha Date: Thu, 22 Feb 2024 05:38:11 -0800 Subject: [PATCH] Use withExtendedLifetime instead of a dummy access The compiler in theory has the latitude to optimize this out otherwise. --- macOS/WindowManager.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/macOS/WindowManager.swift b/macOS/WindowManager.swift index 7be7d36..8c2b90d 100644 --- a/macOS/WindowManager.swift +++ b/macOS/WindowManager.swift @@ -147,7 +147,7 @@ extension AXObserver { // Retain the observer until the stream is finished let _observer = observer continuation.onTermination = { _ in - _ = _observer + withExtendedLifetime(_observer) {} } } }