changeset 791:7b1f30330a19

[xemacs-hg @ 2002-03-21 18:55:01 by adrian] [PATCH] Assert around line 1600 in event-msw.c <3cz31qp4.fsf@arbortext.com>
author adrian
date Thu, 21 Mar 2002 18:55:09 +0000
parents 755d0acc05ea
children 4e83fdb13eb9
files src/ChangeLog src/console-msw.h src/event-msw.c src/process-nt.c
diffstat 4 files changed, 28 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Mar 21 15:47:29 2002 +0000
+++ b/src/ChangeLog	Thu Mar 21 18:55:09 2002 +0000
@@ -1,3 +1,11 @@
+2002-03-14  Mike Alexander  <mta@arbortext.com>
+
+	* event-msw.c (mswindows_unwait_process): New, remove process from
+	wait list
+	* process-nt.c (nt_finalize_process_data): Call
+	mswindows_unwait_process 
+	* console-msw.h: Declare mswindows_unwait_process
+
 2002-03-21  William M. Perry  <wmperry@gnu.org>
 
 	* event-gtk.c (emacs_gtk_force_event_pending): Bogus definition
--- a/src/console-msw.h	Thu Mar 21 15:47:29 2002 +0000
+++ b/src/console-msw.h	Thu Mar 21 18:55:09 2002 +0000
@@ -359,6 +359,8 @@
 HANDLE get_nt_process_handle (Lisp_Process *p);
 #endif
 
+void mswindows_unwait_process (Lisp_Process *p);
+
 extern Lisp_Object Vmswindows_frame_being_created;
 extern Lisp_Object mswindows_frame_being_created;
 
--- a/src/event-msw.c	Thu Mar 21 15:47:29 2002 +0000
+++ b/src/event-msw.c	Thu Mar 21 18:55:09 2002 +0000
@@ -1147,6 +1147,21 @@
 }
 #endif /* HAVE_MSG_SELECT */
 
+/*
+ * Given a lisp process pointer remove the corresponding process handle
+ * from mswindows_waitable_handles if it is in it.  Normally the handle is
+ * removed when the process terminates, but if the lisp process structure
+ * is deleted before the process terminates we must delete the process
+ * handle since it will be invalid and will cause the wait to fail
+ */
+void
+mswindows_unwait_process (Lisp_Process *p)
+{
+#ifndef HAVE_MSG_SELECT
+  remove_waitable_handle (get_nt_process_handle (p));
+#endif /* HAVE_MSG_SELECT */
+}
+
 
 /************************************************************************/
 /*                             Event pump                               */
--- a/src/process-nt.c	Thu Mar 21 15:47:29 2002 +0000
+++ b/src/process-nt.c	Thu Mar 21 18:55:09 2002 +0000
@@ -639,6 +639,9 @@
 nt_finalize_process_data (Lisp_Process *p, int for_disksave)
 {
   assert (!for_disksave);
+  /* If it's still in the list of processes we are waiting on delete
+     it.  */
+  mswindows_unwait_process (p);
   if (NT_DATA (p)->h_process)
     CloseHandle (NT_DATA (p)->h_process);
 }