From ff45fe73493b83a2174309d367d672ab422c459d Mon Sep 17 00:00:00 2001 From: 1024jp <1024jp@wolfrosch.com> Date: Wed, 2 Jun 2021 12:59:16 +0900 Subject: [PATCH] Set automatic termination programatically (fix #1183) --- CHANGELOG.md | 4 ++++ CotEditor/Sources/AppDelegate.swift | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e300485a1..cb27594e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ Change Log 4.0.5 (unreleased) -------------------------- +### Fixes + +- Fix an issue that the application did not terminate when all windows are closed. + 4.0.4 (461) diff --git a/CotEditor/Sources/AppDelegate.swift b/CotEditor/Sources/AppDelegate.swift index cbb27ab85..c4f8cf607 100644 --- a/CotEditor/Sources/AppDelegate.swift +++ b/CotEditor/Sources/AppDelegate.swift @@ -86,6 +86,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate { UserDefaults.standard.register(defaults: defaults) NSUserDefaultsController.shared.initialValues = defaults + // -> Setting `NSSupportsAutomaticTermination` in Info.plist + // doesn't work somehow (2021-06) + ProcessInfo.processInfo.automaticTerminationSupportEnabled = true + // instantiate shared instances _ = DocumentController.shared _ = TextFinder.shared