Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

fix(macos): Swift build error in livetext_bridge autoreleasepool

Louis Beaumont68195d902688
diff --git a/apps/screenpipe-app-tauri/src-tauri/swift/livetext_bridge.swift b/apps/screenpipe-app-tauri/src-tauri/swift/livetext_bridge.swift
index afdf5cd35..b9c90c25a 100644
--- a/apps/screenpipe-app-tauri/src-tauri/swift/livetext_bridge.swift
+++ b/apps/screenpipe-app-tauri/src-tauri/swift/livetext_bridge.swift
@@ -225,16 +225,17 @@ public func ltInit(_ windowPtr: UInt64) -> Int32 {
// can take several seconds. By doing it here the models are ready by
// the time the user navigates to a frame.
Task.detached {
- autoreleasepool {
+ let img: NSImage = autoreleasepool {
let size = NSSize(width: 1, height: 1)
let img = NSImage(size: size)
img.lockFocus()
NSColor.white.setFill()
NSRect(origin: .zero, size: size).fill()
img.unlockFocus()
- let config = ImageAnalyzer.Configuration([.text])
- let _ = try? await analyzer.analyze(img, orientation: .up, configuration: config)
+ return img
}
+ let config = ImageAnalyzer.Configuration([.text])
+ let _ = try? await analyzer.analyze(img, orientation: .up, configuration: config)
}
return 0