emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 948e660: Avoid aborts in native-comp subprocesses wh


From: Eli Zaretskii
Subject: feature/native-comp 948e660: Avoid aborts in native-comp subprocesses when exiting Emacs on Windows
Date: Sun, 7 Mar 2021 09:32:54 -0500 (EST)

branch: feature/native-comp
commit 948e6609b11b0203d6e1d0fdfdcc23b8538f3e98
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>

    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.
---
 src/w32.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/w32.c b/src/w32.c
index 7ce907d..14b8b11 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -10447,6 +10447,13 @@ shutdown_handler (DWORD type)
       || type == CTRL_LOGOFF_EVENT    /* User logs off.  */
       || type == CTRL_SHUTDOWN_EVENT) /* User shutsdown.  */
     {
+      /* If we are being shut down in noninteractive mode, we don't
+        care about the message stack, so clear it to avoid abort in
+        shut_down_emacs.  This happens when an noninteractive Emacs
+        is invoked as a subprocess of Emacs, and the parent wants to
+        kill us, e.g. because it's about to exit.  */
+      if (noninteractive)
+       clear_message_stack ();
       /* Shut down cleanly, making sure autosave files are up to date.  */
       shut_down_emacs (0, Qnil);
     }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]