misc: add disableSuddenTermination in code

This commit is contained in:
yicheng 2021-08-29 22:45:38 +08:00
parent 51ee11c149
commit 93f8150d2a
No known key found for this signature in database
GPG Key ID: 7CF411A6623B1C0A
3 changed files with 5 additions and 1 deletions

View File

@ -66,6 +66,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
}
func applicationDidFinishLaunching(_ notification: Notification) {
Logger.log("applicationDidFinishLaunching")
Logger.log("Appversion: \(AppVersionUtil.currentVersion) \(AppVersionUtil.currentBuild)")
ProcessInfo.processInfo.disableSuddenTermination()
// setup menu item first
statusItem = NSStatusBar.system.statusItem(withLength: statusItemLengthWithSpeed)

View File

@ -88,7 +88,7 @@
<true/>
</dict>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2018年 yichengchen. All rights reserved.</string>
<string>Copyright © 2021年 yichengchen. All rights reserved.</string>
<key>NSMainStoryboardFile</key>
<string>Main</string>
<key>NSPrincipalClass</key>

View File

@ -10,6 +10,7 @@
#import "ProxyConfigHelper.h"
int main(int argc, const char * argv[]) {
@autoreleasepool {
[[NSProcessInfo processInfo] disableSuddenTermination];
[[ProxyConfigHelper new] run];
NSLog(@"ProxyConfigHelper exit");
}