소스 검색

macOS: disable exit on error

osy 5 년 전
부모
커밋
e7edccb3dd
1개의 변경된 파일1개의 추가작업 그리고 9개의 파일을 삭제
  1. 1 9
      Platform/macOS/VMDisplayWindowController.swift

+ 1 - 9
Platform/macOS/VMDisplayWindowController.swift

@@ -120,26 +120,18 @@ extension VMDisplayWindowController: NSToolbarItemValidation {
 
 
 // MARK: - VM Delegate
 // MARK: - VM Delegate
 
 
-var vmHasStartedOnce = false
-
 extension VMDisplayWindowController: UTMVirtualMachineDelegate {
 extension VMDisplayWindowController: UTMVirtualMachineDelegate {
     func virtualMachine(_ vm: UTMVirtualMachine, transitionTo state: UTMVMState) {
     func virtualMachine(_ vm: UTMVirtualMachine, transitionTo state: UTMVMState) {
-        if vmHasStartedOnce && state == .vmStopped {
-            exit(0)
-        }
         switch state {
         switch state {
         case .vmError:
         case .vmError:
             let message = vmMessage ?? NSLocalizedString("An internal error has occured. UTM will terminate.", comment: "VMDisplayWindowController")
             let message = vmMessage ?? NSLocalizedString("An internal error has occured. UTM will terminate.", comment: "VMDisplayWindowController")
-            showErrorAlert(message) { _ in
-                exit(0)
-            }
+            showErrorAlert(message)
         case .vmStopped, .vmPaused, .vmSuspended:
         case .vmStopped, .vmPaused, .vmSuspended:
             enterSuspended(isBusy: false)
             enterSuspended(isBusy: false)
         case .vmPausing, .vmStopping, .vmStarting, .vmResuming:
         case .vmPausing, .vmStopping, .vmStarting, .vmResuming:
             enterSuspended(isBusy: true)
             enterSuspended(isBusy: true)
         case .vmStarted:
         case .vmStarted:
             enterLive()
             enterLive()
-            vmHasStartedOnce = true
         @unknown default:
         @unknown default:
             break
             break
         }
         }