Fix numerous concurrency warnings.

This commit is contained in:
Brent Simmons
2024-04-07 21:32:47 -07:00
parent 4b0e7addc9
commit d1dc4cceec
15 changed files with 98 additions and 74 deletions

View File

@@ -128,8 +128,11 @@ import AppKit
func relaunchFromURL(_ appURL: URL) {
// Relaunching is best achieved by requesting that the system launch the app
// at the given URL with the "new instance" option to prevent it simply reactivating us.
let _ = try? NSWorkspace.shared.launchApplication(at: appURL, options: .newInstance, configuration: [:])
NSApp.terminate(self)
let configuration = NSWorkspace.OpenConfiguration()
configuration.createsNewApplicationInstance = true
NSWorkspace.shared.openApplication(at: appURL, configuration: configuration) { _,_ in
NSApp.terminate(self)
}
}
func defaultHandler() {