From a6f5c67f9d3ba5ec6e7a9233373623d939a4119e Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Mon, 6 Sep 2021 14:52:41 -0500 Subject: [PATCH] Timeout the run loop to get a final return value after two seconds. Fixes #3276 --- Mac/AppDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Mac/AppDelegate.swift b/Mac/AppDelegate.swift index 9cffc8840..a3a50f195 100644 --- a/Mac/AppDelegate.swift +++ b/Mac/AppDelegate.swift @@ -328,7 +328,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations, } let timeout = Date().addingTimeInterval(2) - while !isShutDownSyncDone && RunLoop.current.run(mode: .default, before: .distantFuture) && timeout > Date() { } + while !isShutDownSyncDone && RunLoop.current.run(mode: .default, before: timeout) && timeout > Date() { } } // MARK: Notifications