aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2021-03-07 16:31:35 +0200
committerEli Zaretskii2021-03-07 16:31:35 +0200
commit948e6609b11b0203d6e1d0fdfdcc23b8538f3e98 (patch)
treef8240d86d2fc3a084fc2ed2a7d333ae1cbe5c135 /src
parentf89e70a7041b061eb40f2b5e0c58a28bfb84920f (diff)
downloademacs-948e6609b11b0203d6e1d0fdfdcc23b8538f3e98.tar.gz
emacs-948e6609b11b0203d6e1d0fdfdcc23b8538f3e98.zip
Avoid aborts in native-comp subprocesses when exiting Emacs on Windows
* src/w32.c (shutdown_handler): Clear the message stack when being shut down in noninteractive mode, to avoid aborting in shut_down_emacs when a native-compilation subprocess is killed because the parent Emacs exits.
Diffstat (limited to 'src')
-rw-r--r--src/w32.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/w32.c b/src/w32.c
index 7ce907d0adb..14b8b11da00 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -10447,6 +10447,13 @@ shutdown_handler (DWORD type)
10447 || type == CTRL_LOGOFF_EVENT /* User logs off. */ 10447 || type == CTRL_LOGOFF_EVENT /* User logs off. */
10448 || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown. */ 10448 || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown. */
10449 { 10449 {
10450 /* If we are being shut down in noninteractive mode, we don't
10451 care about the message stack, so clear it to avoid abort in
10452 shut_down_emacs. This happens when an noninteractive Emacs
10453 is invoked as a subprocess of Emacs, and the parent wants to
10454 kill us, e.g. because it's about to exit. */
10455 if (noninteractive)
10456 clear_message_stack ();
10450 /* Shut down cleanly, making sure autosave files are up to date. */ 10457 /* Shut down cleanly, making sure autosave files are up to date. */
10451 shut_down_emacs (0, Qnil); 10458 shut_down_emacs (0, Qnil);
10452 } 10459 }