[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 05/11] ui/cocoa: Do not exit immediately after shutdown
From: |
Gerd Hoffmann |
Subject: |
[PULL 05/11] ui/cocoa: Do not exit immediately after shutdown |
Date: |
Tue, 16 Mar 2021 06:38:07 +0100 |
From: Akihiko Odaki <akihiko.odaki@gmail.com>
ui/cocoa used to call exit immediately after calling
qemu_system_shutdown_request, which prevents QEMU from actually
perfoming system shutdown. Just sleep forever, and wait QEMU to call
exit and kill the Cocoa thread.
Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Message-Id: <20210219111652.20623-1-akihiko.odaki@gmail.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/cocoa.m | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ui/cocoa.m b/ui/cocoa.m
index a7848ae0a30e..9da0e884b712 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1115,7 +1115,13 @@ QemuCocoaView *cocoaView;
COCOA_DEBUG("QemuCocoaAppController: applicationWillTerminate\n");
qemu_system_shutdown_request(SHUTDOWN_CAUSE_HOST_UI);
- exit(0);
+
+ /*
+ * Sleep here, because returning will cause OSX to kill us
+ * immediately; the QEMU main loop will handle the shutdown
+ * request and terminate the process.
+ */
+ [NSThread sleepForTimeInterval:INFINITY];
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication
*)theApplication
--
2.29.2
- [PULL 00/11] Ui 20210316 patches, Gerd Hoffmann, 2021/03/16
- [PULL 04/11] opengl: Do not convert format with glTexImage2D on OpenGL ES, Gerd Hoffmann, 2021/03/16
- [PULL 03/11] ui: deprecate "password" option for SPICE server, Gerd Hoffmann, 2021/03/16
- [PULL 02/11] ui: introduce "password-secret" option for SPICE server, Gerd Hoffmann, 2021/03/16
- [PULL 07/11] ui: avoid sending framebuffer updates outside client desktop bounds, Gerd Hoffmann, 2021/03/16
- [PULL 08/11] ui: use client width/height in WMVi message, Gerd Hoffmann, 2021/03/16
- [PULL 05/11] ui/cocoa: Do not exit immediately after shutdown,
Gerd Hoffmann <=
- [PULL 01/11] ui: introduce "password-secret" option for VNC servers, Gerd Hoffmann, 2021/03/16
- [PULL 10/11] ui: fold qemu_alloc_display in only caller, Gerd Hoffmann, 2021/03/16
- [PULL 09/11] ui: honour the actual guest display dimensions without rounding, Gerd Hoffmann, 2021/03/16
- [PULL 06/11] ui: add more trace points for VNC client/server messages, Gerd Hoffmann, 2021/03/16
- [PULL 11/11] ui/cocoa: Comment about modifier key input quirks, Gerd Hoffmann, 2021/03/16
- Re: [PULL 00/11] Ui 20210316 patches, Peter Maydell, 2021/03/17