Gmane
Favicon
From: Aidan Kehoe <kehoea <at> parhasard.net>
Subject: [PATCH] Check dispatch_event_queue on the TTY, too.
Newsgroups: gmane.emacs.xemacs.patches
Date: 2006-07-18 18:50:22 GMT (5 years, 43 weeks, 1 day, 16 hours and 20 minutes ago)

 Ar an t-ochtú lá déag de mí Iúil, scríobh Stephen J. Turnbull:  

 > Do you mean XEmacs is running on Linux, or that the TTY is on Linux? I
 > can't reproduce with XEmacs running on Linux but displaying to a Mac OS X
 > Terminal.

I’ll bet your binary is built with X11 support, and Jerry’s isn’t. I can
reproduce the problem locally when I build without X11 support, so it’s not
Linux-specific; the issue is that drain_tty_devices in event-unixoid.c adds
events to dispatch_event_queue on a just-TTY-support build, but nothing
reads from dispatch_event_queue. Which then goes and leaks--I hope this is
the memory leak I’ve been seeing on the TTY.

src/ChangeLog addition:

2006-07-18  Aidan Kehoe  <kehoea <at> parhasard.net>

	* event-tty.c (emacs_tty_next_event):
	Check dispatch_event_queue for pending events, since we add to
	that in drain_tty_devices(). Fixes dropped key sequences on TTY
	builds.
	

XEmacs Trunk source patch:
Diff command:   cvs -q diff -u
Files affected: src/event-tty.c

Index: src/event-tty.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-tty.c,v
retrieving revision 1.16
diff -u -u -r1.16 event-tty.c
--- src/event-tty.c	2004/11/04 23:06:27	1.16
+++ src/event-tty.c	2006/07/18 18:39:23
@@ -113,6 +113,16 @@
       EMACS_TIME time_to_block;
       EMACS_SELECT_TIME select_time_to_block, *pointer_to_this;

+      if (!NILP (dispatch_event_queue))
+	{
+	  Lisp_Object event, event2;
+	  event2 = wrap_event (emacs_event);
+	  event = dequeue_dispatch_event ();
+	  Fcopy_event (event, event2);
+	  Fdeallocate_event (event);
+	  return;
+	}
+
       if (!get_low_level_timeout_interval (tty_timer_queue, &time_to_block))
 	/* no timer events; block indefinitely */
  	pointer_to_this = 0;

-- 
Santa Maradona, priez pour moi!