changeset 1320:4f58e6e65139

[xemacs-hg @ 2003-02-22 02:08:32 by ben] oops redisplay.c: Don't get in an infinite loop running post-redisplay actions.
author ben
date Sat, 22 Feb 2003 02:08:33 +0000
parents 48817884fdbb
children 4f69b7a5bf9f
files src/ChangeLog src/redisplay.c
diffstat 2 files changed, 18 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Feb 21 22:52:35 2003 +0000
+++ b/src/ChangeLog	Sat Feb 22 02:08:33 2003 +0000
@@ -1,3 +1,9 @@
+2003-02-21  Ben Wing  <ben@xemacs.org>
+
+	* redisplay.c:
+	* redisplay.c (run_post_redisplay_actions):
+	Don't get in an infinite loop running post-redisplay actions.
+
 2003-02-20  Ben Wing  <ben@xemacs.org>
 
 	* alloc.c:
--- a/src/redisplay.c	Fri Feb 21 22:52:35 2003 +0000
+++ b/src/redisplay.c	Sat Feb 22 02:08:33 2003 +0000
@@ -6715,9 +6715,20 @@
 						  ((void *) fun), arg)));
 }
 
+static int running_post_redisplay_actions;
+
 static void
 run_post_redisplay_actions (void)
 {
+  int depth;
+
+  if (running_post_redisplay_actions)
+    return;
+
+  depth = internal_bind_int (&running_post_redisplay_actions, 1);
+  /* If the function pushes further actions, they will be tacked onto
+     the end of the list, and we'll run them when we're done with the
+     current ones. */
   while (!NILP (Vpost_redisplay_actions))
     {
       Lisp_Object car = XCAR (Vpost_redisplay_actions);
@@ -6728,6 +6739,7 @@
       free_cons (car);
       Vpost_redisplay_actions = XCDR (Vpost_redisplay_actions);
     }
+  unbind_to (depth);
 }
 
 #ifdef ERROR_CHECK_TRAPPING_PROBLEMS