mirror of https://github.com/cirruslabs/tart.git
Graceful Softnet termination (#434)
This commit is contained in:
parent
066f585c53
commit
d7561cab0b
|
|
@ -363,7 +363,13 @@ struct Run: AsyncParsableCommand {
|
|||
VMView(vm: vm!).onAppear {
|
||||
NSWindow.allowsAutomaticWindowTabbing = false
|
||||
}.onDisappear {
|
||||
NSApplication.shared.terminate(self)
|
||||
let ret = kill(getpid(), SIGINT)
|
||||
if ret != 0 {
|
||||
// Fallback to the old termination method that doesn't
|
||||
// propagate the cancellation to Task's in case graceful
|
||||
// termination via kill(2) is not successful
|
||||
NSApplication.shared.terminate(self)
|
||||
}
|
||||
}
|
||||
}.frame(width: CGFloat(vm!.config.display.width), height: CGFloat(vm!.config.display.height))
|
||||
}.commands {
|
||||
|
|
|
|||
Loading…
Reference in New Issue