Handling macOS 13.6 NSApplication Termination Not Triggering cleanUp method in AppDelegate
I keep running into I'm experimenting with I'm working with an scenario where the `applicationWillTerminate(_:)` method in my AppDelegate is not being called on macOS 13.6... This method is designed to perform cleanup tasks, such as saving user data and releasing resources, but it seems to be skipped entirely in certain scenarios. I've tested this by creating a simple macOS application that only logs messages in this method, like so: ```swift class AppDelegate: NSObject, NSApplicationDelegate { func applicationWillTerminate(_ aNotification: Notification) { print("Application is terminating, performing cleanup...") } } ``` However, when I quit the app from the menu or using Command + Q, the message does not appear in the console. I also tried to check for any unhandled exceptions or background processes that could be preventing this method from executing, but everything seems normal. I have also verified that my application is not being force-quit or terminated by the system due to low resources or hanging processes. I am using Swift 5.7 and Xcode 14.1 with the latest updates applied. As a troubleshooting step, I placed a breakpoint in `applicationWillTerminate(_:)`, but it never hits when quitting the application. The only time this method gets called is when I quit via the debug menu in Xcode. I donβt have any long-running tasks or background activities that could interfere with the termination process. Can anyone guide to figure out why this method is not being invoked in the standard quit process? Are there any specific configurations or settings I may have missed that could affect the termination lifecycle? I recently upgraded to Swift stable. For context: I'm using Swift on CentOS. Hoping someone can shed some light on this.